File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1- import { useEffect , useState , type ChangeEvent } from "react" ;
1+ import {
2+ useEffect ,
3+ useState ,
4+ type ChangeEvent ,
5+ type KeyboardEvent ,
6+ } from "react" ;
27import FieldBadges from "./fields/FieldBadges" ;
38import Markdown from "react-markdown" ;
49import type { CollectionEntry } from "astro:content" ;
@@ -95,6 +100,11 @@ const FieldCatalog = ({ fields }: { fields: Fields }) => {
95100 placeholder = "Search fields"
96101 value = { filters . search }
97102 onChange = { ( e ) => setFilters ( { ...filters , search : e . target . value } ) }
103+ onKeyDown = { ( e : KeyboardEvent < HTMLInputElement > ) => {
104+ if ( e . key === "Escape" ) {
105+ setFilters ( { ...filters , search : "" } ) ;
106+ }
107+ } }
98108 />
99109
100110 < div className = "mb-8! hidden md:block" >
You can’t perform that action at this time.
0 commit comments