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

* handle case where body is the scrolling element

* use instanceof Node instead
pull/91341/head^2
Ashley Harrison 12 months ago committed by GitHub
parent 2cccde932c
commit 66bfb31d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx

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

Loading…
Cancel
Save