MCPcopy Create free account
hub / github.com/code100x/cms / handleEscape

Function handleEscape

src/components/Sidebar.tsx:91–95  ·  view source on GitHub ↗
(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

89
90 // listen for ESC key and close the sidebar
91 const handleEscape = (event: KeyboardEvent) => {
92 if (event.key === 'Escape') {
93 closeSidebar();
94 }
95 };
96
97 document.addEventListener('mousedown', handleClickOutside);
98 document.addEventListener('keydown', handleEscape);

Callers

nothing calls this directly

Calls 1

closeSidebarFunction · 0.85

Tested by

no test coverage detected