diff --git a/packages/core/src/components/ModalNew/Modal/Modal.module.scss b/packages/core/src/components/ModalNew/Modal/Modal.module.scss index 9f083ddd63..4da8d1afa2 100644 --- a/packages/core/src/components/ModalNew/Modal/Modal.module.scss +++ b/packages/core/src/components/ModalNew/Modal/Modal.module.scss @@ -1,10 +1,13 @@ .overlay { + --monday-modal-z-index: 10000; position: fixed; inset: 0; background-color: rgba(41, 47, 76, 0.7); + z-index: var(--monday-modal-z-index); } .modal { + --monday-modal-z-index: 10000; --top-actions-spacing: var(--spacing-large); --top-actions-width: var(--spacing-xl); --modal-inline-padding: var(--spacing-xl); @@ -12,6 +15,7 @@ position: fixed; top: 50%; left: 50%; + z-index: var(--monday-modal-z-index); display: flex; flex-direction: column; diff --git a/packages/core/src/components/ModalNew/Modal/Modal.tsx b/packages/core/src/components/ModalNew/Modal/Modal.tsx index 8f323945dd..0a0a7fae54 100644 --- a/packages/core/src/components/ModalNew/Modal/Modal.tsx +++ b/packages/core/src/components/ModalNew/Modal/Modal.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useCallback, useMemo, useState } from "react"; +import React, { forwardRef, useCallback, useMemo, useRef, useState } from "react"; import cx from "classnames"; import { RemoveScroll } from "react-remove-scroll"; import FocusLock from "react-focus-lock"; @@ -21,6 +21,7 @@ import { } from "../utils/animationVariants"; import { createPortal } from "react-dom"; import usePortalTarget from "../hooks/usePortalTarget/usePortalTarget"; +import { LayerProvider } from "../../LayerProvider"; const Modal = forwardRef( ( @@ -44,6 +45,8 @@ const Modal = forwardRef( ) => { const portalTargetElement = usePortalTarget(container); + const overlayRef = useRef(null); + const [titleId, setTitleId] = useState(); const [descriptionId, setDescriptionId] = useState(); @@ -88,56 +91,59 @@ const Modal = forwardRef( return ( {show && ( - - {createPortal( - <> - - - - - {children} - - - - - , - portalTargetElement - )} - + + + {createPortal( + <> + + + + + {children} + + + + + , + portalTargetElement + )} + + )} );