1 Commits

Author SHA1 Message Date
Sebastian Seedorf
c754316935 fix: replace addEventListener with onmouseleave to prevent listener leak 2026-06-05 12:54:37 +02:00
2 changed files with 3 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ export default function TableViz({ config, rows, onEdit, onDelete }: Props) {
<th className="text-right px-2 py-1 text-green-400">Green</th>
)}
{config.signal_type !== 'green' && (
<th className="text-right px-2 py-1 text-red-400">Red</th>
<th className="text-right px-2 py-1 text-red-400">Red (NP)</th>
)}
</tr>
</thead>

View File

@@ -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