MCPcopy Create free account
hub / github.com/vercel/examples / onDocDown

Function onDocDown

python/vibe-coding-ide/frontend/src/components/ProjectTabs.tsx:53–59  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

51
52 React.useEffect(() => {
53 const onDocDown = (e: MouseEvent) => {
54 if (!openMenuId) return
55 // If click happens while a portal overlay is open, allow overlay handlers to manage it
56 const target = e.target as HTMLElement | null
57 if (target && target.closest('[data-project-menu-portal="true"]')) return
58 setOpenMenuId(null)
59 }
60 document.addEventListener('mousedown', onDocDown)
61 return () => document.removeEventListener('mousedown', onDocDown)
62 }, [openMenuId])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected