diff --git a/src/mantine-core/src/Modal/Modal.story.tsx b/src/mantine-core/src/Modal/Modal.story.tsx index 73076ba01a7..ca85f3f0c22 100644 --- a/src/mantine-core/src/Modal/Modal.story.tsx +++ b/src/mantine-core/src/Modal/Modal.story.tsx @@ -95,3 +95,24 @@ export function NativeScrollArea() { ); } + +export function NestedModals() { + const [parentOpened, { open: parentOpen, close: parentClose }] = useDisclosure(false); + const [nestedOpened, { open: nestedOpen, close: nestedClose }] = useDisclosure(false); + + return ( +
+ +
{content}
+ + + + +
Nested Content
+
+
+ + +
+ ); +} diff --git a/src/mantine-core/src/ModalBase/ModalBaseContent/ModalBaseContent.tsx b/src/mantine-core/src/ModalBase/ModalBaseContent/ModalBaseContent.tsx index a2a6e78cb0c..1968bb4cddb 100644 --- a/src/mantine-core/src/ModalBase/ModalBaseContent/ModalBaseContent.tsx +++ b/src/mantine-core/src/ModalBase/ModalBaseContent/ModalBaseContent.tsx @@ -25,7 +25,7 @@ export const ModalBaseContent = forwardRef(( props ); - const { classes, cx } = useStyles({ zIndex: ctx.zIndex + 1 }, ctx.stylesApi); + const { classes, cx } = useStyles({ zIndex: ctx.zIndex }, ctx.stylesApi); const handleKeyDown = (event: React.KeyboardEvent) => { const shouldTrigger =