Skip to content

Fix StatusBar modifications not applying to Modal windows on Android#56059

Open
zoontek wants to merge 3 commits intofacebook:mainfrom
zoontek:fix-modal-status-bar
Open

Fix StatusBar modifications not applying to Modal windows on Android#56059
zoontek wants to merge 3 commits intofacebook:mainfrom
zoontek:fix-modal-status-bar

Conversation

@zoontek
Copy link
Contributor

@zoontek zoontek commented Mar 11, 2026

Summary:

⚠️ Note: This relies on #55721 being merged first.

When a Modal is displayed on Android, it creates a new Dialog with its own Window. Modules like StatusBarModule only apply their configuration to the main Activity's window, so status bar changes (style, visibility) are not reflected in Modal windows.

This PR:

  • Implement ExtraWindowEventListener in StatusBarModule to track extra windows
  • Extract Window extension setStatusBarStyle function into WindowUtil.kt for reuse
  • Omit status bar color and translucency sync, as those functions have no effect when the app is edge-to-edge

This also fixes a race condition that occurs when opening a Modal and changing the status bar state at the same time.

Related issue

Changelog:

[ANDROID] [FIXED] - StatusBar configuration now applies to Modal windows, fixing visual inconsistencies

Test Plan:

  1. Open the RNTester app on Android
  2. Set status bar style or visibility using the StatusBar API
  3. Open a Modal - verify the status bar appearance is preserved
  4. Change the status bar style / visibility while the Modal is open - verify it updates on the Modal window too
  5. Dismiss the Modal - verify the status bar appearance is still correct
transparent-modal.mp4

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 11, 2026
@zoontek zoontek force-pushed the fix-modal-status-bar branch from 98c67ab to e952685 Compare March 11, 2026 15:38
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 11, 2026
@zoontek zoontek force-pushed the fix-modal-status-bar branch from 300d032 to 27bb903 Compare March 11, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants