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

Function handleClickOutside

website/app/components/LanguageToggle.tsx:16–20  ·  view source on GitHub ↗
(event: MouseEvent)

Source from the content-addressed store, hash-verified

14
15 useEffect(() => {
16 function handleClickOutside(event: MouseEvent) {
17 if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
18 setIsOpen(false);
19 }
20 }
21
22 document.addEventListener('mousedown', handleClickOutside);
23 return () => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected