clear search input on Escape
This commit is contained in:
parent
255b77d0cf
commit
43f85aaf96
1 changed files with 6 additions and 0 deletions
|
@ -136,6 +136,12 @@ function SearchToolbar({ query, onChange }) {
|
|||
color="green.800"
|
||||
value={query}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Escape") {
|
||||
onChange("");
|
||||
e.target.blur();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{query && (
|
||||
<InputRightElement>
|
||||
|
|
Loading…
Reference in a new issue