{#each resultNotes as result, i}
+ height={100}
+ offset={500}
+ keep={true}
+ fadeOption={{ delay: 0, duration: 0 }}>
+ }} />
{/each}
diff --git a/src/components/modals.ts b/src/components/modals.ts
index 3ffd6f2..dc6b1f0 100644
--- a/src/components/modals.ts
+++ b/src/components/modals.ts
@@ -4,6 +4,7 @@ import ModalVault from './ModalVault.svelte'
import ModalInFile from './ModalInFile.svelte'
import { Action, eventBus, EventNames, isInputComposition } from '../globals'
import type OmnisearchPlugin from '../main'
+import { mount, unmount } from 'svelte'
abstract class OmnisearchModal extends Modal {
protected constructor(plugin: OmnisearchPlugin) {
@@ -170,7 +171,7 @@ export class OmnisearchVaultModal extends OmnisearchModal {
: null
// Instantiate and display the Svelte component
- const cmp = new ModalVault({
+ const cmp = mount(ModalVault, {
target: this.modalEl,
props: {
plugin,
@@ -178,10 +179,11 @@ export class OmnisearchVaultModal extends OmnisearchModal {
previousQuery: query || selectedText || previous || '',
},
})
+
this.onClose = () => {
// Since the component is manually created,
// we also need to manually destroy it
- cmp.$destroy()
+ unmount(cmp)
}
})
}