Skip to content

formSheet modal is invisible in brownfield Fabric apps until re-render because postponed enter transition never starts #4010

@lhanindeed

Description

@lhanindeed

Description

In brownfield Android apps using Fabric (New Architecture), formSheet modals are invisible upon presentation. The modal is correctly sized and positioned behind the scenes, but the fragment's postponed enter transition is never started, so it never becomes visible. The user must trigger a re-layout (e.g., lock/unlock the screen) for the modal to appear.

Root cause

The bug was introduced in #3404

In ScreenStackFragment.onCreateView(), for formSheet presentation, BottomSheetTransitionCoordinator waits for both a layout callback and an insets callback before calling startPostponedEnterTransition(). In brownfield apps, the host activity's window insets have already been dispatched before the formSheet's ViewCompat.setOnApplyWindowInsetsListener is attached (because the RN surface is hosted inside a fragment that was added to an already-running activity). This means areInsetsApplied in BottomSheetTransitionCoordinator never becomes true, and the postponed enter transition is permanently stuck.

The pre-layout pass in onCreateView() correctly measures and lays out the coordinatorLayout, giving the screen valid dimensions. But the transition doesn't start because it's waiting for the insets callback that will never come.

Steps to reproduce

  1. Set up a brownfield Android app with Fabric enabled (New Architecture)
  2. Host a React Native surface inside a Fragment (e.g., using ReactSurfaceView in a custom Fragment)
  3. Navigate to a screen that presents a formSheet modal
  4. The modal is invisible — the bottom sheet is sized correctly but the fragment transition never starts
  5. Lock and unlock the phone — the modal suddenly becomes visible (because the re-layout triggers the transition)

Snack or a link to a repository

https://github.com/lhanindeed/react-native-screens-brownfield-bug-repro

Screens version

4.24.0

React Native version

0.83.2

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

platform:androidIssue related to Android part of the libraryrepro-providedA reproduction with a snack or repo is provided

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions