Skip to content

Add Modal.dimAmount for Android (#60388) - #60388

Open
evankatz14 wants to merge 1 commit into
react:mainfrom
evankatz14:export-D125038408
Open

evankatz14 wants to merge 1 commit into
react:mainfrom
evankatz14:export-D125038408

Conversation

@evankatz14

@evankatz14 evankatz14 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Add the Android-only Modal.dimAmount prop to control system dimming behind a non-transparent modal. The native value is clamped to 0–1 and defaults to 0.5 when omitted or reset. transparent={true} still disables system dimming and keeps the container transparent.

On Android, explicitly setting dimAmount makes the JS container transparent unless an explicit backdropColor is provided. With dimAmount omitted, existing background behavior is unchanged: transparent takes precedence, then backdropColor, then style.backgroundColor or the white default. An explicit dimAmount also takes precedence over style.backgroundColor when neither transparent nor backdropColor is set.

Deprecate Modal.backdropColor in the public prop types without changing its behavior. Prefer style={{backgroundColor: ...}} for custom container colors, except when combining a custom color with an explicit Android dimAmount: that combination still needs backdropColor in this version.

Replace the duplicate Android dim-flag mask with the equivalent addFlags(FLAG_DIM_BEHIND) call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit backdropColor precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add Modal.dimAmount to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate Modal.backdropColor without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408

@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 Nov 30, 2026
@meta-codesync

meta-codesync Bot commented Nov 30, 2026

Copy link
Copy Markdown

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

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@Abbondanzo Abbondanzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@github-actions

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@meta-codesync meta-codesync Bot changed the title Add Modal.dimAmount for Android Add Modal.dimAmount for Android (#60388) Nov 30, 2026
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Nov 30, 2026
Summary:

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
@evankatz14
evankatz14 force-pushed the export-D125038408 branch 2 times, most recently from 8b60f3f to d5c5514 Compare November 30, 2026 19:48
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Nov 30, 2026
Summary:

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
@evankatz14
evankatz14 requested a review from javache November 30, 2026 23:30
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Nov 30, 2026
Summary:

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Nov 30, 2026
Summary:
Pull Request resolved: react#60388

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
Summary:

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Dec 1, 2026
Summary:

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
@evankatz14
evankatz14 force-pushed the export-D125038408 branch 2 times, most recently from 45a49fe to 6a99370 Compare December 1, 2026 00:34
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Dec 1, 2026
Summary:
Pull Request resolved: react#60388

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Dec 1, 2026
Summary:
Pull Request resolved: react#60388

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Dec 1, 2026
Summary:
Pull Request resolved: react#60388

Add the Android-only `Modal.dimAmount` prop to control system dimming behind a non-transparent modal. The native value is clamped to `0–1` and defaults to `0.5` when omitted or reset. `transparent={true}` still disables system dimming and keeps the container transparent.

On Android, explicitly setting `dimAmount` makes the JS container transparent unless an explicit `backdropColor` is provided. With `dimAmount` omitted, existing background behavior is unchanged: `transparent` takes precedence, then `backdropColor`, then `style.backgroundColor` or the white default. An explicit `dimAmount` also takes precedence over `style.backgroundColor` when neither `transparent` nor `backdropColor` is set.

Deprecate `Modal.backdropColor` in the public prop types without changing its behavior. Prefer `style={{backgroundColor: ...}}` for custom container colors, except when combining a custom color with an explicit Android `dimAmount`: that combination still needs `backdropColor` in this version.

Replace the duplicate Android dim-flag mask with the equivalent `addFlags(FLAG_DIM_BEHIND)` call. Update the Android, C++, and JavaScript API snapshots, and cover prop forwarding and reset, transparent container defaults, and explicit `backdropColor` precedence in the Modal integration tests.

Changelog:
[Android][Added] - Add `Modal.dimAmount` to configure system dimming behind non-transparent modals.
[General][Deprecated] - Deprecate `Modal.backdropColor` without removing it.

Reviewed By: Abbondanzo

Differential Revision: D125038408

This branch has not been deployed

No deployments
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.

3 participants