From 122cc5265599a686a773328b858c0b43cf20573e Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 13 Jul 2026 17:26:26 -0700 Subject: [PATCH 1/2] fix: prevent dev loading view clipping Remove the full-size content view style from the short borderless macOS sheet so AppKit does not apply the clipped sheet frame mask. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-native/React/CoreModules/RCTDevLoadingView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 4eb05b280ccf..3794bc218505 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -181,7 +181,7 @@ - (void)showMessage:(NSString *)message color:(RCTPlatformColor *)color backgrou if (!self->_window) { self->_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20) - styleMask:NSWindowStyleMaskBorderless | NSWindowStyleMaskFullSizeContentView + styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]; [self->_window setIdentifier:sRCTDevLoadingViewWindowIdentifier]; From 574b714ebe40a134675ffd4b25081d66317365fd Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 13 Jul 2026 19:05:22 -0700 Subject: [PATCH 2/2] fix: present dev loading view as child window Avoid AppKit's sheet frame mask by attaching the borderless loading banner to the key window as a centered child window. Apply the banner's rounded corners explicitly and remove matching child windows on hide. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../React/CoreModules/RCTDevLoadingView.mm | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 3794bc218505..531e547e859a 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -175,6 +175,10 @@ - (void)showMessage:(NSString *)message color:(RCTPlatformColor *)color backgrou if (!self->_container) { self->_container = [[RCTUIView alloc] init]; // [macOS] self->_container.translatesAutoresizingMaskIntoConstraints = NO; + self->_container.wantsLayer = YES; + self->_container.layer.cornerRadius = 4; + self->_container.layer.cornerCurve = kCACornerCurveContinuous; + self->_container.layer.masksToBounds = YES; [self->_container addSubview:self->_label]; } self->_container.backgroundColor = backgroundColor; @@ -184,6 +188,8 @@ - (void)showMessage:(NSString *)message color:(RCTPlatformColor *)color backgrou styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]; + self->_window.backgroundColor = [NSColor clearColor]; + self->_window.opaque = NO; [self->_window setIdentifier:sRCTDevLoadingViewWindowIdentifier]; [self->_window.contentView addSubview:self->_container]; } @@ -202,10 +208,14 @@ - (void)showMessage:(NSString *)message color:(RCTPlatformColor *)color backgrou [self->_label.trailingAnchor constraintLessThanOrEqualToAnchor:self->_container.trailingAnchor constant:-10], ]]; - if (![[RCTKeyWindow() sheets] doesContain:self->_window]) { - [RCTKeyWindow() beginSheet:self->_window completionHandler:^(NSModalResponse returnCode) { - [self->_window orderOut:self]; - }]; + NSWindow *parentWindow = RCTKeyWindow(); + if (![[parentWindow childWindows] doesContain:self->_window]) { + NSRect parentFrame = parentWindow.frame; + NSRect loadingFrame = self->_window.frame; + [self->_window setFrameOrigin:NSMakePoint( + NSMidX(parentFrame) - NSWidth(loadingFrame) / 2, + NSMidY(parentFrame) - NSHeight(loadingFrame) / 2)]; + [parentWindow addChildWindow:self->_window ordered:NSWindowAbove]; } #endif // macOS] @@ -250,9 +260,10 @@ - (void)showMessage:(NSString *)message color:(RCTPlatformColor *)color backgrou self->_hiding = false; }]; #else // [macOS] - for (NSWindow *window in [RCTKeyWindow() sheets]) { + for (NSWindow *window in NSApp.windows) { if ([[window identifier] isEqualToString:sRCTDevLoadingViewWindowIdentifier]) { - [RCTKeyWindow() endSheet:window]; + [window.parentWindow removeChildWindow:window]; + [window orderOut:self]; } } self->_window = nil;