Browse Source

Add esc to clear search

master
jeffvli 3 years ago
parent
commit
d116853e6b
  1. 5
      src/components/layout/GenericPageHeader.tsx

5
src/components/layout/GenericPageHeader.tsx

@ -70,6 +70,11 @@ const GenericPageHeader = ({
value={searchQuery}
placeholder="Search..."
onChange={handleSearch}
onKeyDown={(e: KeyboardEvent) => {
if (e.key === 'Escape') {
clearSearchQuery();
}
}}
/>
{searchQuery !== '' && (
<InputGroup.Button appearance="subtle" onClick={clearSearchQuery}>

Loading…
Cancel
Save