@@ -161,6 +161,16 @@ class Dialog extends Component<DialogProps, DialogState> {
161161 }
162162 }
163163
164+ // TODO: revert adding this workaround once RN fixes https://github.com/facebook/react-native/issues/29455
165+ onFadeDone = ( ) => {
166+ if ( ! this . state . modalVisibility ) {
167+ setTimeout ( ( ) => { // unfortunately this is needed if a modal needs to open on iOS
168+ _ . invoke ( this . props , 'onDialogDismissed' , this . props ) ;
169+ _ . invoke ( this . props , 'onModalDismissed' , this . props ) ;
170+ } , 50 ) ;
171+ }
172+ }
173+
164174 onDismiss = ( ) => {
165175 this . setState ( { modalVisibility : false } , ( ) => {
166176 const props = this . props ;
@@ -221,6 +231,7 @@ class Dialog extends Component<DialogProps, DialogState> {
221231 const { useSafeArea, bottom, overlayBackgroundColor, testID} = this . props ;
222232 const addBottomSafeArea = Constants . isIphoneX && ( useSafeArea && bottom ) ;
223233 const bottomInsets = Constants . getSafeAreaInsets ( ) . bottom - 8 ; // TODO: should this be here or in the input style?
234+ const onFadeDone = Constants . isIOS ? this . onFadeDone : undefined ;
224235
225236 return (
226237 < View
@@ -233,6 +244,7 @@ class Dialog extends Component<DialogProps, DialogState> {
233244 modalVisibility = { modalVisibility }
234245 dialogVisibility = { dialogVisibility }
235246 overlayBackgroundColor = { overlayBackgroundColor }
247+ onFadeDone = { onFadeDone }
236248 />
237249 { this . renderDialogView ( ) }
238250 { addBottomSafeArea && < View style = { { marginTop : bottomInsets } } /> }
@@ -253,7 +265,7 @@ class Dialog extends Component<DialogProps, DialogState> {
253265 animationType = { 'none' }
254266 onBackgroundPress = { this . hideDialogView }
255267 onRequestClose = { this . hideDialogView }
256- onDismiss = { this . onModalDismissed }
268+ // onDismiss={this.onModalDismissed}
257269 supportedOrientations = { supportedOrientations }
258270 accessibilityLabel = { accessibilityLabel }
259271 >
0 commit comments