Repository navigation
Add dismissOnClickOutside to Android Modal (#60418) - #60418
Open
evankatz14 wants to merge 3 commits into
Open
evankatz14 wants to merge 3 commits into
evankatz14 wants to merge 3 commits into
Conversation
|
@evankatz14 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D132200976. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
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
Summary: Pull Request resolved: react#60418 Add an opt-in `dismissOnClickOutside` prop to Android `Modal`, used together with `contentSized`. Presses outside the content-sized window are routed through the existing `onRequestClose` callback, so JS still owns `visible`. Without `contentSized` the window fills the parent and the prop has no effect. Changelog: [Android][Added] - Add `dismissOnClickOutside` prop to `Modal` to request closing on presses outside a `contentSized` window. Differential Revision: D132200976
dismissOnClickOutside to Android ModaldismissOnClickOutside to Android Modal (#60418)
evankatz14
force-pushed
the
export-D132200976
branch
from
December 1, 2026 00:44
904290d to
868fc2d
Compare
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
dismissOnClickOutsideprop to AndroidModal, used together withcontentSized.Presses outside the content-sized window are routed through the existing
onRequestClosecallback, so JS still ownsvisible. WithoutcontentSizedthe window fills the parent and the prop has no effect.Changelog:
[Android][Added] - Add
dismissOnClickOutsideprop toModalto request closing on presses outside acontentSizedwindow.Differential Revision: D132200976