Added handle of "Tab" press
This commit is contained in:
parent
0d0c8e5c43
commit
08b1d56cd7
@ -119,6 +119,13 @@ export default function Search({ options }) {
|
|||||||
};
|
};
|
||||||
}, [selectedProvider, options, query, searchSuggestions]);
|
}, [selectedProvider, options, query, searchSuggestions]);
|
||||||
|
|
||||||
|
const handleSearchKeyDown = (event) => {
|
||||||
|
if (event.key === "Tab") {
|
||||||
|
// TODO: add actual tab complete
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const submitCallback = useCallback(
|
const submitCallback = useCallback(
|
||||||
(value) => {
|
(value) => {
|
||||||
const q = encodeURIComponent(value);
|
const q = encodeURIComponent(value);
|
||||||
@ -167,6 +174,7 @@ export default function Search({ options }) {
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
// eslint-disable-next-line jsx-a11y/no-autofocus
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
||||||
autoFocus={options.focus}
|
autoFocus={options.focus}
|
||||||
|
onKeyDown={handleSearchKeyDown}
|
||||||
/>
|
/>
|
||||||
<Listbox
|
<Listbox
|
||||||
as="div"
|
as="div"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user