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

Function handleClickOutside

src/components/Sidebar.tsx:79–88  ·  view source on GitHub ↗
(event: MouseEvent)

Source from the content-addressed store, hash-verified

77
78 useEffect(() => {
79 const handleClickOutside = (event: MouseEvent) => {
80 if (
81 sidebarRef.current &&
82 !sidebarRef.current.contains(event.target as Node) &&
83 !buttonRef.current?.contains(event.target as Node) &&
84 !filterRef.current?.contains(event.target as Node)
85 ) {
86 closeSidebar();
87 }
88 };
89
90 // listen for ESC key and close the sidebar
91 const handleEscape = (event: KeyboardEvent) => {

Callers

nothing calls this directly

Calls 1

closeSidebarFunction · 0.85

Tested by

no test coverage detected