mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fixed tint color for action sheets (#54180)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
committed by
meta-codesync[bot]
parent
82d2352b19
commit
535efc1403
@@ -168,8 +168,15 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
||||
callback(@[ @(localIndex) ]);
|
||||
}
|
||||
}];
|
||||
if (isCancelButtonIndex) {
|
||||
if (isCancelButtonIndex && cancelButtonTintColor != NULL) {
|
||||
[actionButton setValue:cancelButtonTintColor forKey:@"titleTextColor"];
|
||||
} else if (style != UIAlertActionStyleDestructive) {
|
||||
// iOS 26 does not apply the tint color automatically to all the buttons.
|
||||
// So we ca forcibly apply the tint color to all the buttons that are not
|
||||
// destructive (which usually have a different tint color) nor they are
|
||||
// cancel buttons (which might have a different tint color).
|
||||
// This makes the Action Sheet behave as in iOS < 26.
|
||||
[actionButton setValue:tintColor forKey:@"titleTextColor"];
|
||||
}
|
||||
[alertController addAction:actionButton];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user