Skip to content

Make Alert not cancelable by default on Android #24541

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

Closed
wants to merge 2 commits into from

Conversation

JonnyBurger
Copy link
Contributor

Summary

By default, an alert is cancelable on 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.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 20, 2019
Copy link

@analysis-bot analysis-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code analysis results:

  • eslint found some issues. Run yarn lint --fix to automatically fix problems.

Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution! I appreciate that you are aligning this kind of UX stuff between platform, that totally makes sense.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @JonnyBurger in ec941cd.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 23, 2019
@JonnyBurger
Copy link
Contributor Author

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: facebook/react-native-website#899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Alert CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants