MCPcopy Create free account
hub / github.com/chokcoco/iCSS / handleClickOutside

Function handleClickOutside

website/app/components/ThemeToggle.tsx:30–34  ·  view source on GitHub ↗
(event: MouseEvent)

Source from the content-addressed store, hash-verified

28
29 useEffect(() => {
30 function handleClickOutside(event: MouseEvent) {
31 if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
32 setIsOpen(false);
33 }
34 }
35
36 document.addEventListener('mousedown', handleClickOutside);
37 return () => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected