From 08b1d56cd7776c2e3e5156049d9b7d66405c309f Mon Sep 17 00:00:00 2001 From: Flo2410 Date: Thu, 8 Feb 2024 19:52:29 +0000 Subject: [PATCH] Added handle of "Tab" press --- src/components/widgets/search/search.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/widgets/search/search.jsx b/src/components/widgets/search/search.jsx index 6a634308..21c933d2 100644 --- a/src/components/widgets/search/search.jsx +++ b/src/components/widgets/search/search.jsx @@ -119,6 +119,13 @@ export default function Search({ options }) { }; }, [selectedProvider, options, query, searchSuggestions]); + const handleSearchKeyDown = (event) => { + if (event.key === "Tab") { + // TODO: add actual tab complete + event.preventDefault(); + } + }; + const submitCallback = useCallback( (value) => { const q = encodeURIComponent(value); @@ -167,6 +174,7 @@ export default function Search({ options }) { autoComplete="off" // eslint-disable-next-line jsx-a11y/no-autofocus autoFocus={options.focus} + onKeyDown={handleSearchKeyDown} />