MCPcopy Index your code
hub / github.com/027xiguapi/code-box / updateTooltipPosition

Function updateTooltipPosition

component/ui/customDomSelector.tsx:87–97  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

85 }
86
87 const updateTooltipPosition = (element: HTMLElement) => {
88 const rect = element.getBoundingClientRect()
89 const distanceTop = rect.top + window.scrollY
90 const distanceLeft = rect.left + window.scrollX
91 const top =
92 distanceTop < 50 ? distanceTop + rect.height + 5 : distanceTop - 40
93 const left = distanceLeft + 5
94
95 setPosition({ top: top, left: left })
96 window.scrollTo({ top: top - 150, behavior: "smooth" })
97 }
98
99 useMessage(async (req: any, res: any) => {
100 const name = req.name

Callers 2

handleClickFunction · 0.85
navigateElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected