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

fix disableOnBackPress #39

Merged
merged 2 commits into from
Mar 4, 2018
Merged

fix disableOnBackPress #39

merged 2 commits into from
Mar 4, 2018

Conversation

zachrnolan
Copy link
Contributor

It looks like there was some back and forth on this code, but I think this is the best solution.

We should only consider disableOnBackPress if the modal is open, otherwise, you run the risk of disabling the Android hardware back button app-wide.

If the modal is open and disableOnBackPress is false, we close the modal and stop the hardware back button from going back a screen.

If the modal is open and disableOnBackPress is true, we do not close the modal and stop the hardware back button from going back a screen. This allows us to force the user to tap a button on the modal to close or perform other actions.

Let me know if there are any use cases I'm not thinking about.

@httnn
Copy link
Owner

httnn commented Mar 2, 2018

thanks for the PR @zachrnolan! this LGTM, would you mind resolving the conflicts and I'll merge it?

@zachrnolan
Copy link
Contributor Author

@bodyflex resolved, thanks for merging!

@httnn httnn merged commit 9a82c04 into httnn:master Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants