feat: add ability to blur search bar with Escape key

This commit is contained in:
cj-do-gta-sander 2024-10-24 12:24:20 -03:00
parent 3adc8662dc
commit bf6ce2b465

View File

@ -71,6 +71,11 @@ export function Header({ onSearch, onClear, search }: HeaderProps) {
if (!isFocused && ctrlKey && key === "k") {
focusInput();
}
if (isFocused && key === "Escape" && inputRef.current) {
inputRef.current.blur();
handleBlur();
}
};
return () => {