Can't display a dialog after popover did close (iOS only)
See original GitHub issueDescribe the bug
In popoverDoneClosing
I want to open the Alert dialog. On iOS, the alert closes straight after it showed and after that the app freezes. You can’t tap anything, my guess is that popover modal doesn’t close properly and overlays the entire screen (like in #16). If you wrap Alert in setTimeout with 0 (zero) interval you may get this behavior after the second hit. You can try it out in this Expo Snack: https://snack.expo.io/HJFjG-G9V With 100 interval, it’s pretty much ok, but it still freezes occasionally.
Expected bevavior: I call Alert in popoverDoneClosing and it displays without closing and freezing the app, without the need to set a timeout.
Device/Setup Info:
- Device: any iPhone
- OS: iOS 12.2
react-native
version: 0.58.5react-native-popover-view
version: 1.0.19
Debug Output This bug does not reproduce when Remote Debug is enabled.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top GitHub Comments
I was not aware, let me add a platform check in there…
I ran into this issue as well recently, for a quick fix you can pass in
showInModal={false}
. This won’t make a difference as long as you keep the popover as a child of a top-level view, but will have issues if the popover is nested down a few levels inside views with padding and margin.I agree this is an issue and I may be able to fix this by tying into the Modal
onDismiss
prop (https://facebook.github.io/react-native/docs/modal#ondismiss), I’m working on some updates in this area now so keep an eye out for a fix in the next release.