MCPcopy Create free account
hub / github.com/adobe/react-spectrum / handleKeyDown

Function handleKeyDown

packages/react-aria/test/focus/FocusScope.test.js:875–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873 const [display, setDisplay] = useState(false);
874 useEffect(() => {
875 let handleKeyDown = e => {
876 if (e.key === 'Escape') {
877 setDisplay(false);
878 }
879 };
880 document.body.addEventListener('keyup', handleKeyDown);
881 return () => {
882 document.body.removeEventListener('keyup', handleKeyDown);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected