Skip to content

Commit

Permalink
Fix RCTDevLoadingView position (#46005)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
sbuggay authored and facebook-github-bot committed Aug 13, 2024
1 parent bd90a07 commit f9abe96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-native/React/CoreModules/RCTDevLoadingView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,13 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(
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;
Expand Down

0 comments on commit f9abe96

Please sign in to comment.