Repository navigation
Add contentSized to Android Modal (#60408) - #60408
Open
evankatz14 wants to merge 2 commits into
Open
evankatz14 wants to merge 2 commits into
evankatz14 wants to merge 2 commits into
Conversation
|
@evankatz14 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126114637. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
evankatz14
added a commit
to evankatz14/react-native
that referenced
this pull request
Nov 30, 2026
Summary: Pull Request resolved: react#60408 Add an opt-in `contentSized` prop to Android `Modal`. RN normally measures modal content against the full parent size. With `contentSized`, Fabric and the JS wrapper measure the content instead, and the native window is sized to it and centered after layout. Outside presses are consumed by the dialog window, so they do not reach the parent. Ordinary `Modal` keeps its existing window, layout, and animation theme selection. Changelog: [Android][Added] - Add `contentSized` prop to `Modal` to size the native window to its content. Differential Revision: D126114637
evankatz14
force-pushed
the
export-D126114637
branch
from
November 30, 2026 23:36
8219bde to
560c1ad
Compare
contentSized to Android ModalcontentSized to Android Modal (#60408)
evankatz14
added a commit
to evankatz14/react-native
that referenced
this pull request
Dec 1, 2026
Summary: Pull Request resolved: react#60408 Add an opt-in `contentSized` prop to Android `Modal`. RN normally measures modal content against the full parent size. With `contentSized`, Fabric and the JS wrapper measure the content instead, and the native window is sized to it and centered after layout. Outside presses are consumed by the dialog window, so they do not reach the parent. Ordinary `Modal` keeps its existing window, layout, and animation theme selection. Changelog: [Android][Added] - Add `contentSized` prop to `Modal` to size the native window to its content. Differential Revision: D126114637
evankatz14
force-pushed
the
export-D126114637
branch
from
December 1, 2026 00:38
560c1ad to
30e4330
Compare
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: Pull Request resolved: react#60408 Add an opt-in `contentSized` prop to Android `Modal`. RN normally measures modal content against the full parent size. With `contentSized`, Fabric and the JS wrapper measure the content instead, and the native window is sized to it and centered after layout. Outside presses are consumed by the dialog window, so they do not reach the parent. Ordinary `Modal` keeps its existing window, layout, and animation theme selection. Changelog: [Android][Added] - Add `contentSized` prop to `Modal` to size the native window to its content. Differential Revision: D126114637
evankatz14
force-pushed
the
export-D126114637
branch
from
December 1, 2026 00:43
30e4330 to
94224eb
Compare
evankatz14
added a commit
to evankatz14/react-native
that referenced
this pull request
Dec 1, 2026
Summary: Pull Request resolved: react#60408 Add an opt-in `contentSized` prop to Android `Modal`. RN normally measures modal content against the full parent size. With `contentSized`, Fabric and the JS wrapper measure the content instead, and the native window is sized to it and centered after layout. Outside presses are consumed by the dialog window, so they do not reach the parent. Ordinary `Modal` keeps its existing window, layout, and animation theme selection. Changelog: [Android][Added] - Add `contentSized` prop to `Modal` to size the native window to its content. Differential Revision: D126114637
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add an opt-in
contentSizedprop to AndroidModal.RN normally measures modal content against the full parent size. With
contentSized, Fabric and the JS wrapper measure the content instead, and the native window is sized to it and centered after layout. Outside presses are consumed by the dialog window, so they do not reach the parent.Ordinary
Modalkeeps its existing window, layout, and animation theme selection.Changelog:
[Android][Added] - Add
contentSizedprop toModalto size the native window to its content.Differential Revision: D126114637