From 6ce6fa004df77c83efa194bea74cbe5b6c45a5a8 Mon Sep 17 00:00:00 2001 From: adel-ak Date: Wed, 12 Oct 2022 22:28:54 +0300 Subject: [PATCH] [@mantine/core] Popover: fixed issue with popover/menu not staying in place --- src/mantine-core/src/Popover/use-popover.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mantine-core/src/Popover/use-popover.ts b/src/mantine-core/src/Popover/use-popover.ts index 478c6e28d46..e1f6b58309c 100644 --- a/src/mantine-core/src/Popover/use-popover.ts +++ b/src/mantine-core/src/Popover/use-popover.ts @@ -8,6 +8,7 @@ import { size, Middleware, inline, + limitShift, } from '@floating-ui/react-dom-interactions'; import { FloatingPosition, useFloatingAutoUpdate } from '../Floating'; import { PopoverWidth, PopoverMiddlewares } from './Popover.types'; @@ -31,7 +32,7 @@ function getPopoverMiddlewares(options: UsePopoverOptions) { const middlewares: Middleware[] = [offset(options.offset)]; if (options.middlewares.shift) { - middlewares.push(shift()); + middlewares.push(shift({ limiter: limitShift() })); } if (options.middlewares.flip) {