@@ -171,44 +171,50 @@ function BaseModal(
171171 } ) ;
172172
173173 return (
174- < ReactNativeModal
175- onBackdropPress = { handleBackdropPress }
176- // Note: Escape key on web/desktop will trigger onBackButtonPress callback
177- // eslint-disable-next-line react/jsx-props-no-multi-spaces
178- onBackButtonPress = { onClose }
179- onModalShow = { handleShowModal }
180- propagateSwipe = { propagateSwipe }
181- onModalHide = { hideModal }
182- onModalWillShow = { ( ) => ComposerFocusManager . resetReadyToFocus ( ) }
183- onDismiss = { handleDismissModal }
184- onSwipeComplete = { ( ) => onClose ?.( ) }
185- swipeDirection = { swipeDirection }
186- isVisible = { isVisible }
187- backdropColor = { theme . overlay }
188- backdropOpacity = { hideBackdrop ? 0 : variables . overlayOpacity }
189- backdropTransitionOutTiming = { 0 }
190- hasBackdrop = { fullscreen }
191- coverScreen = { fullscreen }
192- style = { modalStyle }
193- deviceHeight = { windowHeight }
194- deviceWidth = { windowWidth }
195- animationIn = { animationIn ?? modalStyleAnimationIn }
196- animationOut = { animationOut ?? modalStyleAnimationOut }
197- useNativeDriver = { useNativeDriverProp && useNativeDriver }
198- hideModalContentWhileAnimating = { hideModalContentWhileAnimating }
199- animationInTiming = { animationInTiming }
200- animationOutTiming = { animationOutTiming }
201- statusBarTranslucent = { statusBarTranslucent }
202- onLayout = { onLayout }
203- avoidKeyboard = { avoidKeyboard }
204- >
205- < View
206- style = { [ styles . defaultModalContainer , modalContainerStyle , modalPaddingStyles , ! isVisible && styles . pointerEventsNone ] }
207- ref = { ref }
174+ // this is a workaround for modal not being visible on the new arch in some cases
175+ // it's necessary to have a non-collapseable view as a parent of the modal to prevent
176+ // a conflict between RN core and Reanimated shadow tree operations
177+ // position absolute is needed to prevent the view from interfering with flex layout
178+ < View collapsable = { false } style = { [ styles . pAbsolute ] } >
179+ < ReactNativeModal
180+ onBackdropPress = { handleBackdropPress }
181+ // Note: Escape key on web/desktop will trigger onBackButtonPress callback
182+ // eslint-disable-next-line react/jsx-props-no-multi-spaces
183+ onBackButtonPress = { onClose }
184+ onModalShow = { handleShowModal }
185+ propagateSwipe = { propagateSwipe }
186+ onModalHide = { hideModal }
187+ onModalWillShow = { ( ) => ComposerFocusManager . resetReadyToFocus ( ) }
188+ onDismiss = { handleDismissModal }
189+ onSwipeComplete = { ( ) => onClose ?.( ) }
190+ swipeDirection = { swipeDirection }
191+ isVisible = { isVisible }
192+ backdropColor = { theme . overlay }
193+ backdropOpacity = { hideBackdrop ? 0 : variables . overlayOpacity }
194+ backdropTransitionOutTiming = { 0 }
195+ hasBackdrop = { fullscreen }
196+ coverScreen = { fullscreen }
197+ style = { modalStyle }
198+ deviceHeight = { windowHeight }
199+ deviceWidth = { windowWidth }
200+ animationIn = { animationIn ?? modalStyleAnimationIn }
201+ animationOut = { animationOut ?? modalStyleAnimationOut }
202+ useNativeDriver = { useNativeDriverProp && useNativeDriver }
203+ hideModalContentWhileAnimating = { hideModalContentWhileAnimating }
204+ animationInTiming = { animationInTiming }
205+ animationOutTiming = { animationOutTiming }
206+ statusBarTranslucent = { statusBarTranslucent }
207+ onLayout = { onLayout }
208+ avoidKeyboard = { avoidKeyboard }
208209 >
209- < ColorSchemeWrapper > { children } </ ColorSchemeWrapper >
210- </ View >
211- </ ReactNativeModal >
210+ < View
211+ style = { [ styles . defaultModalContainer , modalContainerStyle , modalPaddingStyles , ! isVisible && styles . pointerEventsNone ] }
212+ ref = { ref }
213+ >
214+ < ColorSchemeWrapper > { children } </ ColorSchemeWrapper >
215+ </ View >
216+ </ ReactNativeModal >
217+ </ View >
212218 ) ;
213219}
214220
0 commit comments