Skip to content

Commit ec941cd

Browse files
JonnyBurgerfacebook-github-bot
authored andcommitted
Make Alert not cancelable by default on Android (#24541)
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 [Android] [Changed] - By default, alerts are not dismissable Pull Request resolved: #24541 Differential Revision: D15044798 Pulled By: cpojer fbshipit-source-id: 762b2ace69eb7ec79cd6ebec916e473348b9cafe
1 parent b76acd3 commit ec941cd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Libraries/Alert/Alert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Alert {
5656
let config = {
5757
title: title || '',
5858
message: message || '',
59+
cancelable: false,
5960
};
6061

6162
if (options) {

0 commit comments

Comments
 (0)