diff --git a/frontend/src/component/commandBar/CommandBar.tsx b/frontend/src/component/commandBar/CommandBar.tsx index 3659db6709..ced6d07b87 100644 --- a/frontend/src/component/commandBar/CommandBar.tsx +++ b/frontend/src/component/commandBar/CommandBar.tsx @@ -288,6 +288,10 @@ export const CommandBar = () => { }, ); + useKeyboardShortcut({ key: 'Tab' }, () => { + setShowSuggestions(false); + }); + useOnClickOutside([searchContainerRef], hideSuggestions); const onKeyDown = (event: React.KeyboardEvent) => { if (event.key === 'Escape') { @@ -301,15 +305,6 @@ export const CommandBar = () => { } }; - const onBlur = (evt: React.FocusEvent) => { - if ( - evt.relatedTarget === null || - !searchContainerRef.current?.contains(evt.relatedTarget) - ) { - hideSuggestions(); - } - }; - return ( { + {searchString !== undefined && ( { } elseShow={ showSuggestions && ( - +