From 76e822af398c8dea653302a037434ab622c31182 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Fri, 23 Dec 2022 10:14:46 +0100 Subject: [PATCH] Prometheus: Fix exemplar popover overflow (#60189) Add popover modifiers to fix overflow issue --- .../panel/timeseries/plugins/ExemplarMarker.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx b/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx index 53a9cd1b7c2..c502eabf961 100644 --- a/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx +++ b/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx @@ -37,7 +37,22 @@ export const ExemplarMarker: React.FC = ({ const [isOpen, setIsOpen] = useState(false); const [markerElement, setMarkerElement] = React.useState(null); const [popperElement, setPopperElement] = React.useState(null); - const { styles: popperStyles, attributes } = usePopper(markerElement, popperElement); + const { styles: popperStyles, attributes } = usePopper(markerElement, popperElement, { + modifiers: [ + { + name: 'preventOverflow', + options: { + altAxis: true, + }, + }, + { + name: 'flip', + options: { + fallbackPlacements: ['top', 'left-start'], + }, + }, + ], + }); const popoverRenderTimeout = useRef(); const getSymbol = () => {