diff --git a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm index 6472cc44f0bc00..d13f3bc43ba566 100644 --- a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm +++ b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm @@ -20,6 +20,28 @@ using namespace facebook::react; +// With popover action sheet, cancel button disappears with style = UIAlertActionStyleCancel +// Reverting to default style when: +// - building with SDK 26+ AND running on iOS 26+ AND UIDesignRequiresCompatibility is disabled +// - running on iPad +static inline UIAlertActionStyle RCTActionStyleForCancelButton(void) +{ + if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) { + return UIAlertActionStyleDefault; + } + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000 + if (@available(iOS 26, *)) { + if ([[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIDesignRequiresCompatibility"] boolValue]) { + return UIAlertActionStyleCancel; + } + + return UIAlertActionStyleDefault; + } +#endif + return UIAlertActionStyleCancel; +} + @interface RCTActionSheetManager () @property (nonatomic, strong) NSMutableArray *alertControllers; @@ -154,7 +176,7 @@ - (void)presentViewController:(UIViewController *)alertController if ([destructiveButtonIndices containsObject:@(index)]) { style = UIAlertActionStyleDestructive; } else if (index == cancelButtonIndex) { - style = UIAlertActionStyleCancel; + style = RCTActionStyleForCancelButton(); isCancelButtonIndex = true; }