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

Function handleClickOutside

src/components/WorkspaceDropdown.jsx:26–30  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

24 // Close dropdown on outside click
25 useEffect(() => {
26 function handleClickOutside(event) {
27 if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
28 setIsOpen(false);
29 }
30 }
31 document.addEventListener("mousedown", handleClickOutside);
32 return () => document.removeEventListener("mousedown", handleClickOutside);
33 }, []);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected