diff --git a/src/components/InputSearch.svelte b/src/components/InputSearch.svelte index 7d70654..49706b9 100644 --- a/src/components/InputSearch.svelte +++ b/src/components/InputSearch.svelte @@ -11,7 +11,10 @@ onMount(async () => { await tick() elInput.focus() - elInput.select() + setTimeout(() => { + // tick() is not working here? + elInput.select() + }, 0) }) const debouncedOnInput = debounce(() => { diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index c314453..65e4777 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -1,5 +1,5 @@ - (searchQuery = e.detail)} /> + (searchQuery = e.detail)} /> {#each resultNotes as result, i} diff --git a/src/modals.ts b/src/modals.ts index 6cdf1ac..23ee139 100644 --- a/src/modals.ts +++ b/src/modals.ts @@ -88,6 +88,16 @@ abstract class OmnisearchModal extends Modal { e.preventDefault() eventBus.emit('tab') // Switch context }) + + // Search history + this.scope.register(['Alt'], 'ArrowDown', e => { + e.preventDefault() + eventBus.emit('next-search-history') + }) + this.scope.register(['Alt'], 'ArrowUp', e => { + e.preventDefault() + eventBus.emit('prev-search-history') + }) } }