From 66bfb31d8ea9b0a189cd92731934cbac6b76adeb Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Thu, 1 Aug 2024 14:34:23 +0200 Subject: [PATCH] Tooltip: Handle case where `document.body` is the scrolling element (#91385) * handle case where body is the scrolling element * use instanceof Node instead --- .../grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx b/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx index 2478a716ec5..d2d362162a4 100644 --- a/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx +++ b/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);