Skip to content

Commit

Permalink
fix: test focus lock esm [prerelease]
Browse files Browse the repository at this point in the history
  • Loading branch information
YossiSaadi committed Dec 31, 2024
1 parent ceb1a7f commit 9ce7e22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 2 additions & 5 deletions packages/core/src/components/Modal/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
(
{
Expand Down Expand Up @@ -114,7 +111,7 @@ const Modal = forwardRef(
aria-hidden
style={zIndexStyle}
/>
<FocusLockComponent returnFocus>
<FocusLock returnFocus>
<RemoveScroll forwardProps>
<motion.div
variants={modalAnimationVariants}
Expand Down Expand Up @@ -146,7 +143,7 @@ const Modal = forwardRef(
/>
</motion.div>
</RemoveScroll>
</FocusLockComponent>
</FocusLock>
</>,
portalTargetElement
)}
Expand Down

0 comments on commit 9ce7e22

Please sign in to comment.