-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
Android Modal doesn't handle the back button #6612
Labels
Resolution: Locked
This issue was locked by the bot.
Comments
9 tasks
You need to override onRequestClose prop which is called when the back button is pushed. |
We should generate a warning in Modal.js when onRequestClose is not set. It seems pretty easy to forget. |
Is it not a required prop? |
No, it's not (we'd need to make it conditionally required on Android): https://github.com/facebook/react-native/blob/master/Libraries/Modal/Modal.js#L64 |
@javache PR sent. |
zebulgar
pushed a commit
to nightingale/react-native
that referenced
this issue
Jun 18, 2016
…ebook#6612 Summary:The `onRequestClose` prop can be used to handle dismissing the modal by back button. It's pretty easy to miss the `onRequestClose` prop on Android. So making it a required prop makes sure that it generates a warning when not supplied. Context facebook#6612 Closes facebook#6667 Differential Revision: D3102054 Pulled By: javache fb-gh-sync-id: 878240606285d231b5592a438918e441765bfe5f fbshipit-source-id: 878240606285d231b5592a438918e441765bfe5f
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried using the Android Modal in 0.23.0-rc1. Did
react-native init AwesomeApp
, changed the version in package.json to 0.23.0-rc1 and rannpm install
(actually I just tested using Sinopia but should be the same result).Then I wrapped the
<Text>
"To get started, edit index.android.js" in a<Modal>
. The Modal renders correctly but:Therefore I am now stuck in this state:
The text was updated successfully, but these errors were encountered: