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 2024-08-01 14:34:23 +02:00 committed by GitHub
parent 2cccde932c
commit 66bfb31d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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