React-native-navigation: [V4] iOS 13 Modal bugs

Created on 6 Dec 2019  路  4Comments  路  Source: wix/react-native-navigation

Issue Description

Loving the new iOS 13 modal animation! However we found some bugs relating the new feature.

Swipe-down modal dismissal does not trigger modal dismissed event.

The following code is a snippet from the reproduction I've created. I've attached the modal dismissed listener on the modal and when it is dismissed by calling Navigation.dismissModal it successfully prompts the alert, however when the modal is dismissed by swiping down gesture, it doesn't.

const modalDismissEvent = Navigation.events().registerModalDismissedListener(
  ({ componentId: modalId }) => {
    if (modalId !== componentId) return
    Alert.alert('Modal Dismissed!')
  }
)

Modal background colour

I've noticed that on other Apple apps, even when the dark mode is not on, the background of the app when modal is present is black. The following image is from Apple Calendars app, you can see that the background is black.

Simulator Screen Shot - iPhone 11 - 2019-12-06 at 14 08 38

Whereas the RNN shows the white background when dark mode isn't turned on - see the following image. However when dark mode is turned on, it does show the background as black.

Simulator Screen Shot - iPhone 11 - 2019-12-06 at 14 09 44

Steps to Reproduce / Code Snippets / Screenshots

I've created a reproduction here, checkout repro/ios-13-modal branch.


Environment

  • React Native Navigation version: 4.0.3
  • React Native version: 0.60.5
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Both, >= iOS 13
Wix iOS 13 iOS accepteenhancement

Most helpful comment

@jinshin1013 We're tracking it internally and it's being worked on right now

All 4 comments

We'll add an event to indicate when modals are dismissed. The event will be emitted when a modal is dismissed by command (dismissModal or dismissAllModals) or by gesture.

// componentId - id of top modal (currently visible modal)
// modalsDismissed - the number of modals dismissed, usually 1 but can be more if multiple modals are visible and dismissAllModals is called
Navigation.events().registerModalDismissedListener(({ componentId, modalsDismissed }) => {
  }
)

We're also looking into the window background color issue

@yogevbd Can we reopen this for modal background colour bug unless there is one opened tracking the problem?

@jinshin1013 We're tracking it internally and it's being worked on right now

Thanks for letting me know! Looking forward to the fix :)

Was this page helpful?
0 / 5 - 0 ratings