use keyboard for navigation between searchbox and table list

This commit is contained in:
Jan Prochazka
2024-11-22 10:03:49 +01:00
parent 1a930acf0a
commit e6bbe66873
3 changed files with 43 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
$: searchValue = value || '';
export let isDebounced = false;
export let onFocusFilteredList = null;
let domInput;
@@ -14,9 +15,17 @@
if (e.keyCode == keycodes.escape) {
value = '';
}
if (e.keyCode == keycodes.downArrow) {
onFocusFilteredList?.();
e.preventDefault();
}
}
const debouncedSet = _.debounce(x => (value = x), 500);
export function focus() {
domInput.focus();
}
</script>
<input