diff --git a/web/components/ChartCard/usePlot.ts b/web/components/ChartCard/usePlot.ts index a84ea6b..b0eb7a8 100644 --- a/web/components/ChartCard/usePlot.ts +++ b/web/components/ChartCard/usePlot.ts @@ -57,11 +57,11 @@ export function usePlot( // Defer mouseleave — prevents React hydration events firing before lastIdxRef set requestAnimationFrame(() => { - plot.over.addEventListener('mouseleave', () => { + plot.over.onmouseleave = () => { const p = plotRef.current; if (!p) return; p.setCursor({ left: idxToPixel(p, lastIdxRef.current), top: -10 }); - }); + }; }); } // deps is intentionally dynamic — passed by parent to allow external rebuild triggers