@@ -161,6 +161,16 @@ class Dialog extends Component<DialogProps, DialogState> {
161
161
}
162
162
}
163
163
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
+
164
174
onDismiss = ( ) => {
165
175
this . setState ( { modalVisibility : false } , ( ) => {
166
176
const props = this . props ;
@@ -221,6 +231,7 @@ class Dialog extends Component<DialogProps, DialogState> {
221
231
const { useSafeArea, bottom, overlayBackgroundColor, testID} = this . props ;
222
232
const addBottomSafeArea = Constants . isIphoneX && ( useSafeArea && bottom ) ;
223
233
const bottomInsets = Constants . getSafeAreaInsets ( ) . bottom - 8 ; // TODO: should this be here or in the input style?
234
+ const onFadeDone = Constants . isIOS ? this . onFadeDone : undefined ;
224
235
225
236
return (
226
237
< View
@@ -233,6 +244,7 @@ class Dialog extends Component<DialogProps, DialogState> {
233
244
modalVisibility = { modalVisibility }
234
245
dialogVisibility = { dialogVisibility }
235
246
overlayBackgroundColor = { overlayBackgroundColor }
247
+ onFadeDone = { onFadeDone }
236
248
/>
237
249
{ this . renderDialogView ( ) }
238
250
{ addBottomSafeArea && < View style = { { marginTop : bottomInsets } } /> }
@@ -253,7 +265,7 @@ class Dialog extends Component<DialogProps, DialogState> {
253
265
animationType = { 'none' }
254
266
onBackgroundPress = { this . hideDialogView }
255
267
onRequestClose = { this . hideDialogView }
256
- onDismiss = { this . onModalDismissed }
268
+ // onDismiss={this.onModalDismissed}
257
269
supportedOrientations = { supportedOrientations }
258
270
accessibilityLabel = { accessibilityLabel }
259
271
>
0 commit comments