mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 17:06:01 +00:00
use keyboard for navigation between searchbox and table list
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user