mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 09:50:29 -06:00
Prometheus: Fix exemplar popover overflow (#60189)
Add popover modifiers to fix overflow issue
This commit is contained in:
parent
33e4a93e36
commit
76e822af39
@ -37,7 +37,22 @@ export const ExemplarMarker: React.FC<ExemplarMarkerProps> = ({
|
|||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [markerElement, setMarkerElement] = React.useState<HTMLDivElement | null>(null);
|
const [markerElement, setMarkerElement] = React.useState<HTMLDivElement | null>(null);
|
||||||
const [popperElement, setPopperElement] = React.useState<HTMLDivElement | null>(null);
|
const [popperElement, setPopperElement] = React.useState<HTMLDivElement | null>(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<NodeJS.Timer>();
|
const popoverRenderTimeout = useRef<NodeJS.Timer>();
|
||||||
|
|
||||||
const getSymbol = () => {
|
const getSymbol = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user