Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't display a dialog after popover did close (iOS only) #40

Closed
3rdp opened this issue Apr 15, 2019 · 7 comments
Closed

Can't display a dialog after popover did close (iOS only) #40

3rdp opened this issue Apr 15, 2019 · 7 comments
Labels

Comments

@3rdp
Copy link

3rdp commented Apr 15, 2019

Describe 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.5
  • react-native-popover-view version: 1.0.19

Debug Output
This bug does not reproduce when Remote Debug is enabled.

@SteffeyDev
Copy link
Owner

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.

@SteffeyDev SteffeyDev added the bug label Apr 15, 2019
@3rdp
Copy link
Author

3rdp commented Apr 16, 2019

onDismiss works nice, why not just pass a callback for it and this should wrap this up

@SteffeyDev
Copy link
Owner

already done, just need to do some testing and documentation

@SteffeyDev
Copy link
Owner

Ok, just released version 2.0.0, the prop is now onCloseComplete and by default it is mapped to onDismiss. I tested and it can consistently open an Alert with no need to timeout. Check it out when you get the change and let me know how it works for you! I've made a number of other changes, so check out the upgrading section of the readme to see other breaking changes.

@3rdp
Copy link
Author

3rdp commented Apr 17, 2019

@SteffeyDev awesome. Did you know that onDismiss prop in Modal is iOS-only though?

@SteffeyDev
Copy link
Owner

I was not aware, let me add a platform check in there...

@SteffeyDev
Copy link
Owner

Ok fixed (hopefully). v. 2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants