From f9abe96d1938d6c664fbf95c5a35663b0b140f2c Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Tue, 13 Aug 2024 16:23:15 -0700 Subject: [PATCH] Fix RCTDevLoadingView position (#46005) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46005 The RCTDevLoadingView is clipped in Mac Catalyst, hiding half of it under the toolbar. This change maintains the behavior on iOS of extending past the dynamic island. {F1803665273} Changelog: [Internal] Reviewed By: shwanton Differential Revision: D61209780 fbshipit-source-id: 6c9c572a9e47a8caf191c40fb53c4a7d43b64281 --- packages/react-native/React/CoreModules/RCTDevLoadingView.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 12736cd5297..0444602156d 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -119,8 +119,13 @@ RCT_EXPORT_MODULE() CGFloat windowWidth = window.bounds.size.width; self->_window = [[UIWindow alloc] initWithWindowScene:window.windowScene]; +#if TARGET_OS_MACCATALYST + self->_window.frame = CGRectMake(0, window.safeAreaInsets.top, windowWidth, 20); + self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, windowWidth, 20)]; +#else self->_window.frame = CGRectMake(0, 0, windowWidth, window.safeAreaInsets.top + 10); self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top - 10, windowWidth, 20)]; +#endif [self->_window addSubview:self->_label]; self->_window.windowLevel = UIWindowLevelStatusBar + 1;