From 7413fcd8709a869f210e6e4919c73ea84351b318 Mon Sep 17 00:00:00 2001 From: Ivan Shumilin Date: Sun, 28 Aug 2022 19:28:13 +0300 Subject: [PATCH] [@mantine/hooks] use-focus-trap: Fix animation bug for modal (#1753) --- src/mantine-hooks/src/use-focus-trap/use-focus-trap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mantine-hooks/src/use-focus-trap/use-focus-trap.ts b/src/mantine-hooks/src/use-focus-trap/use-focus-trap.ts index 297060af978..3f72b1cc547 100644 --- a/src/mantine-hooks/src/use-focus-trap/use-focus-trap.ts +++ b/src/mantine-hooks/src/use-focus-trap/use-focus-trap.ts @@ -30,7 +30,7 @@ export function useFocusTrap(active = true): (instance: HTMLElement | null) => v } if (focusElement) { - focusElement.focus(); + focusElement.focus({ preventScroll: true }); } else if (process.env.NODE_ENV === 'development') { // eslint-disable-next-line no-console console.warn(