From 9190fb28e82c8ff8430a029f94743152252f40d4 Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Wed, 28 Feb 2024 11:42:46 -0600 Subject: [PATCH] VizTooltip: Improve edge positioning and a11y (#83584) --- .../src/components/uPlot/plugins/TooltipPlugin2.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx b/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx index f2ce44ecdce..2302c11c642 100644 --- a/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx +++ b/packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin2.tsx @@ -509,7 +509,13 @@ export const TooltipPlugin2 = ({ if (plot && isHovering) { return createPortal( -
+
{isPinned && } {contents}
, @@ -527,7 +533,7 @@ const getStyles = (theme: GrafanaTheme2, maxWidth?: number, maxHeight?: number) zIndex: theme.zIndex.tooltip, whiteSpace: 'pre', borderRadius: theme.shape.radius.default, - position: 'absolute', + position: 'fixed', background: theme.colors.background.primary, border: `1px solid ${theme.colors.border.weak}`, boxShadow: theme.shadows.z2,