@@ -8,7 +8,7 @@ import React, {
88 useRef ,
99 useState ,
1010} from 'react' ;
11- import { Dialog , Modal as RACModal } from 'react-aria-components' ;
11+ import { Dialog , Modal as RACModal , ModalOverlay } from 'react-aria-components' ;
1212
1313export interface ModalProps {
1414 centered ?: boolean ;
@@ -104,24 +104,26 @@ export const Modal = forwardRef<ModalHandle, ModalProps>(
104104 } , [ hide , open , maskClosable , keyboardClosable ] ) ;
105105
106106 return open ? (
107- < RACModal
108- ref = { containerRef }
107+ < ModalOverlay
109108 isOpen = { open }
110- isDismissable = { keyboardClosable }
111109 onOpenChange = { isOpen => {
112110 ! isOpen && hide ( ) ;
113111 } }
112+ isDismissable = { keyboardClosable }
113+ className = "fixed left-0 top-0 z-10 flex h-[--visual-viewport-height] w-full items-center justify-center bg-black/30"
114114 >
115- < Dialog aria-label = "Modal" className = { classes } >
116- < div
117- className = "modal__backdrop overlay theme--transparent-overlay"
118- { ...( maskClosable ? { 'data-close-modal' : true } : { } ) }
119- />
120- < div className = { classnames ( 'modal__content__wrapper' , { 'modal--centered' : centered } ) } >
121- < div className = "modal__content" > { children } </ div >
122- </ div >
123- </ Dialog >
124- </ RACModal >
115+ < RACModal ref = { containerRef } >
116+ < Dialog aria-label = "Modal" className = { classes } >
117+ < div
118+ className = "modal__backdrop overlay theme--transparent-overlay"
119+ { ...( maskClosable ? { 'data-close-modal' : true } : { } ) }
120+ />
121+ < div className = { classnames ( 'modal__content__wrapper' , { 'modal--centered' : centered } ) } >
122+ < div className = "modal__content" > { children } </ div >
123+ </ div >
124+ </ Dialog >
125+ </ RACModal >
126+ </ ModalOverlay >
125127 ) : null ;
126128 } ,
127129) ;
0 commit comments