File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import React, {
99import ReactDOM from 'react-dom' ;
1010import { CSSTransition } from 'react-transition-group' ;
1111import ThemeExport from '../ThemeExport' ;
12+ import { SpectrumThemeProvider } from '../theme/SpectrumThemeProvider' ;
1213
1314interface ModalProps {
1415 className ?: string ;
@@ -101,7 +102,9 @@ function Modal({
101102
102103 return element . current
103104 ? ReactDOM . createPortal (
104- < >
105+ // Without the zIndex and position props
106+ // the modal is rendered on top of nested DatePicker popovers
107+ < SpectrumThemeProvider isPortal zIndex = { 0 } position = "relative" >
105108 < CSSTransition
106109 appear
107110 mountOnEnter
@@ -171,7 +174,7 @@ function Modal({
171174 </ div >
172175 </ div >
173176 </ CSSTransition >
174- </ > ,
177+ </ SpectrumThemeProvider > ,
175178 element . current
176179 )
177180 : null ;
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ export interface SpectrumThemeProviderProps {
99 isPortal ?: boolean ;
1010 theme ?: Theme ;
1111 colorScheme ?: 'light' | 'dark' ;
12+ zIndex ?: number ;
13+ position ?: 'static' | 'absolute' | 'fixed' | 'relative' | 'sticky' ;
1214}
1315
1416/**
@@ -23,6 +25,8 @@ export function SpectrumThemeProvider({
2325 isPortal = false ,
2426 theme = themeDHDefault ,
2527 colorScheme,
28+ zIndex,
29+ position,
2630} : SpectrumThemeProviderProps ) : JSX . Element {
2731 // a unique ID is used per provider to force it to render the theme wrapper element inside portals
2832 // based on https://github.com/adobe/react-spectrum/issues/1697#issuecomment-999827266
@@ -34,6 +38,8 @@ export function SpectrumThemeProvider({
3438 UNSAFE_className = "spectrum-theme-provider"
3539 theme = { theme }
3640 colorScheme = { colorScheme }
41+ zIndex = { zIndex }
42+ position = { position }
3743 data-unique-id = { id }
3844 >
3945 { children }
You can’t perform that action at this time.
0 commit comments