diff --git a/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx b/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx index 96e6a506413..50f7f976166 100644 --- a/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx +++ b/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx @@ -45,13 +45,13 @@ export const VizTooltipContainer: React.FC = ({ const tH = Math.floor(entry.contentRect.height + 2 * 8); if (tooltipMeasurement.width !== tW || tooltipMeasurement.height !== tH) { setTooltipMeasurement({ - width: tW, - height: tH, + width: Math.min(tW, width), + height: Math.min(tH, height), }); } } }), - [tooltipMeasurement] + [tooltipMeasurement, width, height] ); useLayoutEffect(() => {