Merge branch 'master' into feature/25-search-filters

This commit is contained in:
Simon Cambier
2022-04-28 20:44:21 +02:00

View File

@@ -2,7 +2,7 @@
import { debounce } from "obsidian"
import { createEventDispatcher, onMount, tick } from "svelte"
export let value = ''
export let value = ""
const dispatch = createEventDispatcher()
let elInput: HTMLInputElement
@@ -13,6 +13,14 @@ onMount(async () => {
elInput.select()
})
function onKeydown(e: KeyboardEvent) {
switch (e.key) {
case "ArrowUp":
case "ArrowDown":
e.preventDefault()
}
}
const debouncedOnInput = debounce(() => {
dispatch("input", value)
}, 100)
@@ -22,6 +30,7 @@ const debouncedOnInput = debounce(() => {
bind:value
bind:this={elInput}
on:input={debouncedOnInput}
on:keydown={onKeydown}
type="text"
class="prompt-input"
placeholder="Type to search through your notes"