Skip to content

Commit

Permalink
Update alert.md with new APIs facebook#929 (facebook#943)
Browse files Browse the repository at this point in the history
* update alert.md with new APIs for facebook#929

- Update type
- Update Android documentation

* Update alert.md
  • Loading branch information
Benny Ogidan authored and cpojer committed May 20, 2019
1 parent e62fd99 commit 7ef9364
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ On Android at most three buttons can be specified. Android has a concept of a ne
- Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
- Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')

By default alerts on Android are not dismissable by tapping outside of the alert box (since v0.60). To enable it, you can pass an optional `options` object with the `cancelable` property set to `true`. The dismissal event can be handled by adding an `onDismiss` callback property to `options`. Note: Alerts are never dismissable on iOS.
By default alerts on Android can be dismissed by tapping outside of the alert box. This event can be handled by providing an optional options parameter, with an onDismiss callback property { onDismiss: () => {} }.

Alternatively, the dismissing behavior can be disabled altogether by providing an optional options parameter with the cancelable property set to false i.e. { cancelable: false }

Example usage:

Expand All @@ -56,8 +58,7 @@ Alert.alert(
},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
// Cancelability by tapping outside the popup can be enabled on Android
{cancelable: true, onDismiss: () => {}},
{cancelable: false},
);
```

Expand All @@ -74,5 +75,5 @@ Alert.alert(
### `alert()`

```javascript
static alert(title, message?, buttons?, options?)
static alert(title, message?, buttons?, options? type?)
```

0 comments on commit 7ef9364

Please sign in to comment.