Skip to content

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