1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: remove focus on ESC (#7535)

Now when pressing ESC, command bar will lose focus.


![image](https://github.com/Unleash/unleash/assets/964450/9aea3b2b-bf06-4910-96be-0a67472945af)
This commit is contained in:
Jaanus Sellin 2024-07-03 22:15:59 +03:00 committed by GitHub
parent bf2df49bd6
commit 8dd77f3bbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -195,6 +195,9 @@ export const CommandBar = () => {
);
useKeyboardShortcut({ key: 'Escape' }, () => {
setShowSuggestions(false);
if (searchContainerRef.current?.contains(document.activeElement)) {
searchInputRef.current?.blur();
}
});
const placeholder = `Command bar (${hotkey})`;