Limit tooltip size to window size (#47303)

This commit is contained in:
Oscar Kilhed 2022-04-05 13:35:02 +02:00 committed by GitHub
parent 6a059dcb4d
commit 910ed77e16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,13 +45,13 @@ export const VizTooltipContainer: React.FC<VizTooltipContainerProps> = ({
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(() => {