#39 - Fixed keypress events not correctly prevented

This commit is contained in:
Simon Cambier
2022-04-30 20:35:32 +02:00
parent ca04ed80c9
commit ba56898170
3 changed files with 14 additions and 18 deletions

View File

@@ -13,14 +13,6 @@ onMount(async () => {
elInput.select()
})
function onKeydown(e: KeyboardEvent) {
switch (e.key) {
case "ArrowUp":
case "ArrowDown":
e.preventDefault()
}
}
const debouncedOnInput = debounce(() => {
dispatch("input", value)
}, 100)
@@ -30,7 +22,6 @@ 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"