Skip to content

Commit 653a19a

Browse files
danilobuergerfacebook-github-bot
authored andcommitted
Allow preferred Alert button regardless of the style (#34253)
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
1 parent a70354d commit 653a19a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Libraries/Alert/Alert.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ class Alert {
137137
cancelButtonKey = String(index);
138138
} else if (btn.style === 'destructive') {
139139
destructiveButtonKey = String(index);
140-
} else if (btn.isPreferred) {
140+
}
141+
if (btn.isPreferred) {
141142
preferredButtonKey = String(index);
142143
}
143144
if (btn.text || index < (callbackOrButtons || []).length - 1) {

0 commit comments

Comments
 (0)