Skip to content

Commit

Permalink
Allow preferred Alert button regardless of the style (#34253)
Browse files Browse the repository at this point in the history
Summary:
See #32538 for the discussion

cc robbie-c

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Allow preferred Alert button regardless of the style

Pull Request resolved: #34253

Test Plan: Same test plan as PR mentioned above

Reviewed By: lunaleaps

Differential Revision: D38112619

Pulled By: cipolleschi

fbshipit-source-id: 2ac4fc6226a859e69f0df27913898effa5e092eb
  • Loading branch information
danilobuerger authored and facebook-github-bot committed Jul 25, 2022
1 parent a70354d commit 653a19a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class Alert {
cancelButtonKey = String(index);
} else if (btn.style === 'destructive') {
destructiveButtonKey = String(index);
} else if (btn.isPreferred) {
}
if (btn.isPreferred) {
preferredButtonKey = String(index);
}
if (btn.text || index < (callbackOrButtons || []).length - 1) {
Expand Down

0 comments on commit 653a19a

Please sign in to comment.