MCPcopy Create free account
hub / github.com/github/docs / close

Function close

components/page-header/Header.tsx:70–74  ·  view source on GitHub ↗
(e: { key: string })

Source from the content-addressed store, hash-verified

68
69 useEffect(() => {
70 const close = (e: { key: string }) => {
71 if (e.key === 'Escape') {
72 setIsSearchOpen(false)
73 }
74 }
75 window.addEventListener('keydown', close)
76 return () => window.removeEventListener('keydown', close)
77 }, [])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected