Skip to content

Commit 535efc1

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Fixed tint color for action sheets (#54180)
Summary: Pull Request resolved: #54180 in iOS 26, the tintColor prop is not applied by default to the action sheets buttons. This change fixes it by restoring the same behavior we had before iOS 26. ## Changelog: [iOS][Fixed] - Apply tint color to Actions sheets buttons Reviewed By: cortinico Differential Revision: D84844319 fbshipit-source-id: e211d0a735ea2da35f825c3568d66ba83e4ad832
1 parent 82d2352 commit 535efc1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/react-native/React/CoreModules/RCTActionSheetManager.mm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,15 @@ - (void)presentViewController:(UIViewController *)alertController
168168
callback(@[ @(localIndex) ]);
169169
}
170170
}];
171-
if (isCancelButtonIndex) {
171+
if (isCancelButtonIndex && cancelButtonTintColor != NULL) {
172172
[actionButton setValue:cancelButtonTintColor forKey:@"titleTextColor"];
173+
} else if (style != UIAlertActionStyleDestructive) {
174+
// iOS 26 does not apply the tint color automatically to all the buttons.
175+
// So we ca forcibly apply the tint color to all the buttons that are not
176+
// destructive (which usually have a different tint color) nor they are
177+
// cancel buttons (which might have a different tint color).
178+
// This makes the Action Sheet behave as in iOS < 26.
179+
[actionButton setValue:tintColor forKey:@"titleTextColor"];
173180
}
174181
[alertController addAction:actionButton];
175182

0 commit comments

Comments
 (0)