mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Limit tooltip size to window size (#47303)
This commit is contained in:
parent
6a059dcb4d
commit
910ed77e16
@ -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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user