Skip to content

Commit

Permalink
Added info about a cancelable option for Alerts on Android.
Browse files Browse the repository at this point in the history
Summary:
In the 8e2906a commit there was implemented a cancelable option for Alerts. It wasn't clear from the docs about this option and the additional Alert method's parameter.
Closes facebook#11292

Differential Revision: D4342707

Pulled By: lacker

fbshipit-source-id: dc243b868106e705040e77bc90d4d9b8c2dc26eb
  • Loading branch information
Kevin Lacker authored and facebook-github-bot committed Dec 17, 2016
1 parent c27cc9c commit 9f3ef48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Libraries/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ type Options = {
* - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
* - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')
*
* Note that by default alerts on Android can be dismissed by clicking outside of their alert box.
* To prevent this behavior, you can provide
* an optional `options` parameter `{ cancelable: false }` to the Alert method.
*
* Example usage:
* ```
* // Works on both iOS and Android
* Alert.alert(
Expand All @@ -61,7 +66,8 @@ type Options = {
* {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
* {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
* {text: 'OK', onPress: () => console.log('OK Pressed')},
* ]
* ],
* { cancelable: false }
* )
* ```
*/
Expand Down

0 comments on commit 9f3ef48

Please sign in to comment.