Tooltip: Handle case where document.body is the scrolling element (#91385)

* handle case where body is the scrolling element

* use instanceof Node instead
This commit is contained in:
Ashley Harrison authored and GitHub committed 2024-08-01 13:34:23 +01:00
1 parent 2cccde932c
commit 66bfb31d8e
1 file changed
+1 -1
@@ -580,7 +580,7 @@ export const TooltipPlugin2 = ({
const onscroll = (e: Event) => {
updatePlotVisible();
_isHovering && e.target instanceof HTMLElement && e.target.contains(_plot!.root) && dismiss();
_isHovering && e.target instanceof Node && e.target.contains(_plot!.root) && dismiss();
};
window.addEventListener('resize', updateWinSize);