Description
We are seeing an Android regression where touch hit testing becomes broken on the previous RNSScreen after a fullscreen video flow changes orientation and then returns to the previous screen.
This appears to be related to the Android orientation-change layout fix from #3295, specifically the androidResetScreenShadowStateOnOrientationChangeEnabled / RNSScreenShadowNodeCommitHook path.
Environment
react-native-screens: reproduced with 4.19.0 and 4.25.2
react-native: 0.86.0
expo: ~57.0.4
expo-router: ~57.0.4
- Platform: Android
- New Architecture/Fabric: enabled by default in Expo SDK 57
- Navigation: Expo Router / native stack
Regression range
react-native-screens@4.18.0: works
react-native-screens@4.19.0: broken
react-native-screens@4.25.2: broken
react-native-screens@4.25.2 with androidResetScreenShadowStateOnOrientationChangeEnabled default changed from true to false: works
Reproduction pattern
- Open a stack screen, for example a workspace/file-list screen.
- Navigate to a video player screen.
- Enter fullscreen video, which changes the device/app orientation to landscape.
- Exit fullscreen, returning orientation to portrait.
- Dismiss the video player and return to the previous stack screen.
- Try tapping content inside the previous screen.
Actual behavior
The native header still responds to taps, but the previous screen content area becomes mostly unresponsive.
For example:
- file/folder list items mostly cannot be tapped;
- repeated taps may occasionally trigger something;
- native header back button still works;
- tab/root screens still work;
- entering the same screen again as a new screen instance restores normal touch behavior;
- manually rotating the device again also restores normal touch behavior.
This makes it look like the old RNSScreen content area's native layout / hit-test state is stale after the fullscreen orientation transition.
Expected behavior
After exiting fullscreen and dismissing the video player screen, the previous screen should receive touches normally.
Workaround that fixes it
Keeping react-native-screens@4.25.2, this local patch fixes the issue for us:
-const RNS_ANDROID_RESET_SCREEN_SHADOW_STATE_ON_ORIENTATION_CHANGE_DEFAULT = true;
+const RNS_ANDROID_RESET_SCREEN_SHADOW_STATE_ON_ORIENTATION_CHANGE_DEFAULT = false;
and in the codegen spec:
androidResetScreenShadowStateOnOrientationChangeEnabled?: CT.WithDefault<
boolean,
- true
+ false
>;
After that patch, the same fullscreen video orientation flow no longer breaks touch handling on the previous screen.
Why this looks related to #3295
#3295 introduced a commit hook that detects orientation changes and resets RNSScreen frame size so Yoga recalculates layout. That matches the regression boundary exactly: 4.18.0 works, 4.19.0 fails.
The issue also seems consistent with later work such as commit aedf1ee / #4200, whose description says stale Yoga measurements can still be received after orientation changes and avoids applying Yoga layout directly to StackHost children.
Our case may be another path where the orientation reset happens while a fullscreen/modal video screen is being dismissed and the previous screen is being revealed. The parent/root/native dimensions may not be fully synchronized yet, so the recalculated Yoga layout or hit-test geometry for the previous screen can become stale until another full orientation/layout pass occurs.
Description
We are seeing an Android regression where touch hit testing becomes broken on the previous
RNSScreenafter a fullscreen video flow changes orientation and then returns to the previous screen.This appears to be related to the Android orientation-change layout fix from #3295, specifically the
androidResetScreenShadowStateOnOrientationChangeEnabled/RNSScreenShadowNodeCommitHookpath.Environment
react-native-screens: reproduced with4.19.0and4.25.2react-native:0.86.0expo:~57.0.4expo-router:~57.0.4Regression range
react-native-screens@4.18.0: worksreact-native-screens@4.19.0: brokenreact-native-screens@4.25.2: brokenreact-native-screens@4.25.2withandroidResetScreenShadowStateOnOrientationChangeEnableddefault changed fromtruetofalse: worksReproduction pattern
Actual behavior
The native header still responds to taps, but the previous screen content area becomes mostly unresponsive.
For example:
This makes it look like the old
RNSScreencontent area's native layout / hit-test state is stale after the fullscreen orientation transition.Expected behavior
After exiting fullscreen and dismissing the video player screen, the previous screen should receive touches normally.
Workaround that fixes it
Keeping
react-native-screens@4.25.2, this local patch fixes the issue for us:and in the codegen spec:
After that patch, the same fullscreen video orientation flow no longer breaks touch handling on the previous screen.
Why this looks related to #3295
#3295 introduced a commit hook that detects orientation changes and resets
RNSScreenframe size so Yoga recalculates layout. That matches the regression boundary exactly:4.18.0works,4.19.0fails.The issue also seems consistent with later work such as commit aedf1ee / #4200, whose description says stale Yoga measurements can still be received after orientation changes and avoids applying Yoga layout directly to StackHost children.
Our case may be another path where the orientation reset happens while a fullscreen/modal video screen is being dismissed and the previous screen is being revealed. The parent/root/native dimensions may not be fully synchronized yet, so the recalculated Yoga layout or hit-test geometry for the previous screen can become stale until another full orientation/layout pass occurs.