Skip to content

Fix Android navigation bar transparency for Modal - #58491

Open
jasozh wants to merge 1 commit into
react:mainfrom
jasozh:export-D119589178
Open

Fix Android navigation bar transparency for Modal#58491
jasozh wants to merge 1 commit into
react:mainfrom
jasozh:export-D119589178

Conversation

@jasozh

@jasozh jasozh commented Sep 11, 2026

Copy link
Copy Markdown

Summary:
Fixes the issue described in #39018, where it is currently impossible to draw a correct modal scrim on Android. The issue described the modal scrim not covering both the status bar and the navigation bar. While the status bar is now already covered, the navigation bar is not.

Root Cause

Modal currently has two Android props related to translucency: statusBarTranslucent and navigationBarTranslucent. Both options are essentially redundant on modern Android devices, as edge-to-edge mode in React Native has been enabled for all Android 15+ devices.

Even with navigation bar translucency enabled, the 3-button navigation bar and 2-button gesture bar still have a semi-opaque contrast bar overlaid on top. The color is based on the current device theming: light mode shows black nav buttons with a semi-opaque white background, while dark mode shows white nav buttons with a semi-opqaue black background.

This leads to an issue when a light mode app wants to open a semi-transparent dark modal scrim. Since the nav bar still has a semi-white background, the modal scrim looks off and not fully edge to edge.

This PR

Modify ReactModalHostView so that when Modal's transparent prop is set to true and navigationBarTranslucent is enabled, disable isNavigationBarContrastEnforced. This maintains the existing contract for transparent which assumes the Modal fills the entire view.

Changelog: [Android][Fixed] Fix Android navigation bar transparency for Modal

Differential Revision: D119589178

Summary:
Fixes the issue described in [react#39018](react#39018), where it is currently impossible to draw a correct modal scrim on Android. The issue described the modal scrim not covering both the status bar and the navigation bar. While the status bar is now already covered, the navigation bar is not.

### Root Cause

Modal currently has two Android props related to translucency: `statusBarTranslucent` and `navigationBarTranslucent`. Both options are essentially redundant on modern Android devices, as edge-to-edge mode in React Native has been enabled for all Android 15+ devices.

Even with navigation bar translucency enabled, the 3-button navigation bar and 2-button gesture bar still have a semi-opaque contrast bar overlaid on top. The color is based on the current device theming: light mode shows black nav buttons with a semi-opaque white background, while dark mode shows white nav buttons with a semi-opqaue black background.

This leads to an issue when a light mode app wants to open a semi-transparent dark modal scrim. Since the nav bar still has a semi-white background, the modal scrim looks off and not fully edge to edge.

### This PR

Modify `ReactModalHostView` so that when Modal's `transparent` prop is set to true and `navigationBarTranslucent` is enabled, disable `isNavigationBarContrastEnforced`. This maintains the existing contract for `transparent` which assumes the Modal fills the entire view.

Changelog: [Android][Fixed] Fix Android navigation bar transparency for Modal

Differential Revision: D119589178
@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 Sep 11, 2026
@meta-codesync

meta-codesync Bot commented Sep 11, 2026

Copy link
Copy Markdown

@jasozh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D119589178.

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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant