From 9ce7e22249766942f598c4e07090f68a77990a0d Mon Sep 17 00:00:00 2001 From: Yossi Saadi Date: Tue, 31 Dec 2024 15:59:20 +0200 Subject: [PATCH] fix: test focus lock esm [prerelease] --- packages/core/package.json | 2 +- packages/core/src/components/Modal/Modal/Modal.tsx | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 52d957b96e..d0a693a4bf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -92,7 +92,7 @@ "monday-ui-style": "0.21.0", "prop-types": "^15.8.1", "react-dates": "21.8.0", - "react-focus-lock": "^2.13.2", + "react-focus-lock": "github:YossiSaadi/react-focus-lock#fix/yossi/allow-running-focus-lock-in-vitest", "react-inlinesvg": "^4.1.3", "react-is": "^16.9.0", "react-popper": "^2.3.0", diff --git a/packages/core/src/components/Modal/Modal/Modal.tsx b/packages/core/src/components/Modal/Modal/Modal.tsx index 31e1b23d2c..39186724f2 100644 --- a/packages/core/src/components/Modal/Modal/Modal.tsx +++ b/packages/core/src/components/Modal/Modal/Modal.tsx @@ -23,9 +23,6 @@ import { createPortal } from "react-dom"; import usePortalTarget from "../hooks/usePortalTarget/usePortalTarget"; import { LayerProvider } from "../../LayerProvider"; -// @ts-expect-error This is a precaution to support all possible module systems (ESM/CJS) -const FocusLockComponent = (FocusLock.default || FocusLock) as typeof FocusLock; - const Modal = forwardRef( ( { @@ -114,7 +111,7 @@ const Modal = forwardRef( aria-hidden style={zIndexStyle} /> - + - + , portalTargetElement )}