MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / handler

Function handler

src/components/LayersPanel.tsx:32–36  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

30 useEffect(() => {
31 if (!open) return;
32 const handler = (e: MouseEvent) => {
33 if (panelRef.current && !panelRef.current.contains(e.target as Node)) {
34 setOpen(false);
35 }
36 };
37 document.addEventListener("mousedown", handler);
38 return () => document.removeEventListener("mousedown", handler);
39 }, [open]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected