Uh oh!
There was an error while loading. Please reload this page.
Make Alert not cancelable by default on Android - #24541
Conversation
analysis-bot
left a comment
There was a problem hiding this comment.
Code analysis results:
eslintfound some issues. Runyarn lint --fixto automatically fix problems.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cpojer
left a comment
There was a problem hiding this comment.
Thanks for this contribution! I appreciate that you are aligning this kind of UX stuff between platform, that totally makes sense.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
react-native-bot
commented
Apr 23, 2019
This pull request was successfully merged by @JonnyBurger in ec941cd. When will my fix make it into a release? | Upcoming Releases |
JonnyBurger
commented
Apr 23, 2019
Happy to do it! Thanks for taking the time to weigh in, review and merge. I have also created a PR for docs to correctly reflect the new behavior: react/react-native-website#899 |
Summary
By default, an alert is
cancelableon Android but not on iOS.This PR changes the behavior so that the Alert is not dismissable on Android by default.
The motivation is that many developers develop on iOS and test on Android, and do forget to consider the case that the alert is dismissable.
Consistent behavior by default makes it easier to develop cross-platform apps in general.
For context and for your consideration, I have started a discussion here with the topic of whether React Native should try to use OS defaults or be consistent between platforms:
react-native-community/discussions-and-proposals#121
If this PR gets merged, the docs should be updated as well:
https://github.com/facebook/react-native-website/blob/master/docs/alert.md#android
Changelog
[Android] [Changed] - By default, alerts are not dismissable
Test Plan
By testing out the change in
node_modules, I have found that the change has the intended effect.