fix(CDS-2231): prevent Overlay/Modal scrim collapsing to 0x0 under Fabric#804
Merged
Merged
Conversation
…bric Under Fabric (Expo 56 / RN 0.85), an inset-only absolute view (`pin="all"` with no explicit size) collapses to 0x0 in Yoga, so the Drawer/Tray backdrop Overlay and the Modal container never paint and never receive dismiss taps. Give the shared Overlay scrim and the Modal container explicit full-window dimensions via `useWindowDimensions`. This mirrors the fix the Retail team validated on CMR v8 / RN 0.85 (consumer/react-native#70975 for Overlay and the CMR v8 cds-mobile patch for Modal), and lets those downstream patches be dropped once this ships. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
✅ Heimdall Review Status
✅
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
✅
1/1
|
Denominator calculation
|
Contributor
hcopp
approved these changes
Jul 22, 2026
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.
What changed? Why?
Under Fabric (Expo SDK 56 / React Native 0.85+ / new Yoga), an inset-only absolute view —
pin="all"(position: absolute; top/right/bottom/left: 0) with no explicitwidth/heightand no intrinsically-sized children — collapses to 0×0. This affects twocds-mobilescrims:Overlaybackdrop used byDrawer/Tray/Alert.Modalcontainer (which doesn't useOverlay).When collapsed, the scrim never paints (no dimming) and never receives the
onTouchStartthat dismisses the overlay (iOS skips zero-size views during hit-testing), so the Drawer/Tray/Modal backdrop is invisible and non-interactive.The fix gives both the
Overlayscrim and theModalcontainer explicit full-window dimensions viauseWindowDimensions().Root cause (required for bugfixes)
pin="all"produces an inset-only absolute box. On RN 0.81's Yoga this still stretches to fill, but the Yoga version shipped with RN 0.85 (Expo 56) collapses a size-less inset-only absolute view to 0×0. Giving it explicit windowwidth/heightrestores a concrete size.Validation
This is not reproducible on
apps/expo-appyet because it's still on the older CMR (Expo 54 / RN 0.81.5); the bug only manifests on the newer Yoga.The fix mirrors the exact approach already validated in production on CMR v8 / RN 0.85 by the Retail team:
Overlay:consumer/react-native#70975(useWindowDimensions+ explicitwidth/height), confirmed live on the iOS simulator.Modal: the same fix already present in the CMR v8@cbhq/cds-mobileYarn patch (Modal.jshunk).Landing this upstream lets both of those downstream patches be dropped once Retail bumps to a
cds-mobilerelease containing it.UI changes
No visual change on the current supported RN. Under Fabric/RN 0.85 it restores the dimmed, tappable backdrop (vs. an invisible, non-interactive one).
Testing
How has it been tested?
Testing instructions
Added regression tests asserting the
Overlayscrim andModalcontainer are sized to the full window (Dimensions.get('window')) so they cannot collapse to 0×0. All 12 overlay suites pass (yarn nx run mobile:test overlays);mobile:typecheckandmobile:lintare clean. Note: jsdom tests encode the fix's intent — the native Yoga collapse itself can only be exercised on RN 0.85 (see Validation above).Change management
type=routine
risk=low
impact=sev4
automerge=false
Fixes CDS-2231.
Made with Cursor