From da56ad61fcb49909726b3f07ffbd941a61b1489a Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Thu, 16 Jan 2025 08:26:29 -0800 Subject: [PATCH] Fix "paused on debugger" overlay icon Summary: This icon was broken by D65457771, identified in [OSS testing for the 0.77 release](https://github.com/reactwg/react-native-releases/issues/724). By explicitly setting the image for the `Disabled` state to the same as `Normal`, we get the same behaviour as the deprecated [`adjustsImageWhenDisabled = NO`](https://developer.apple.com/documentation/uikit/uibutton/adjustsimagewhendisabled?language=objc) without the need for `configurationUpdateHandler`. Changelog: [iOS][Fixed] Restore "Paused in debugger" overlay icon Differential Revision: D68274336 --- .../DevSupport/RCTPausedInDebuggerOverlayController.mm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/react-native/React/DevSupport/RCTPausedInDebuggerOverlayController.mm b/packages/react-native/React/DevSupport/RCTPausedInDebuggerOverlayController.mm index 8be2bce952a330..32697c942eea9a 100644 --- a/packages/react-native/React/DevSupport/RCTPausedInDebuggerOverlayController.mm +++ b/packages/react-native/React/DevSupport/RCTPausedInDebuggerOverlayController.mm @@ -54,13 +54,11 @@ - (void)viewDidLoad ]]; UIButton *resumeButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [resumeButton setImage:[UIImage systemImageNamed:@"forward.frame.fill"] forState:UIControlStateNormal]; + UIImage *image = [UIImage systemImageNamed:@"forward.frame.fill"]; + [resumeButton setImage:image forState:UIControlStateNormal]; + [resumeButton setImage:image forState:UIControlStateDisabled]; resumeButton.tintColor = [UIColor colorWithRed:0.37 green:0.37 blue:0.37 alpha:1]; - resumeButton.configurationUpdateHandler = ^(UIButton *button) { - button.imageView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal; - }; - resumeButton.enabled = NO; [NSLayoutConstraint activateConstraints:@[ [resumeButton.widthAnchor constraintEqualToConstant:48],