MCPcopy Create free account
hub / github.com/GreatStackDev/project-management / handleClickOutside

Function handleClickOutside

src/components/Sidebar.jsx:19–23  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

17
18 useEffect(() => {
19 function handleClickOutside(event) {
20 if (sidebarRef.current && !sidebarRef.current.contains(event.target)) {
21 setIsSidebarOpen(false);
22 }
23 }
24 document.addEventListener("mousedown", handleClickOutside);
25 return () => document.removeEventListener("mousedown", handleClickOutside);
26 }, [setIsSidebarOpen]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected