MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / handleClickOutside

Function handleClickOutside

src/components/LocationAutocomplete.tsx:23–27  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

21 useEffect(() => { setQuery(value); }, [value]);
22
23 useEffect(() => {
24 const handleClickOutside = (e: MouseEvent) => {
25 if (containerRef.current && !containerRef.current.contains(e.target as Node)) {
26 setShowResults(false);
27 }
28 };
29 document.addEventListener("mousedown", handleClickOutside);
30 return () => document.removeEventListener("mousedown", handleClickOutside);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected