From 6aa574a93e2d64b54cfcbd6abc23a85d6eef7bd5 Mon Sep 17 00:00:00 2001 From: Adel ak <47484379+Adel-ak@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:11:10 +0300 Subject: [PATCH] [@mantine/core] Popover: Fix issue when dropdown could be scrolled pass its target (#2694) --- 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) {