Fix *Tab* key submitting search

pull/2867/head
Flo2410 4 months ago
parent 97f6b40a6a
commit e47054a2c5
No known key found for this signature in database
GPG Key ID: 8ECB00AC5216DC7F

@ -119,6 +119,12 @@ export default function Search({ options }) {
};
}, [selectedProvider, options, query, searchSuggestions]);
const handleSearchKeyDown = (event) => {
if (event.key === "Tab") {
event.preventDefault();
}
};
const submitCallback = useCallback(
(value) => {
const q = encodeURIComponent(value);
@ -168,6 +174,7 @@ export default function Search({ options }) {
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={options.focus}
onBlur={(e) => e.preventDefault()}
onKeyDown={handleSearchKeyDown}
/>
<Listbox
as="div"

Loading…
Cancel
Save