Skip to content

[ScrollView][iOS] Enable immediate ScrollContentView state updates in open source - #60592

Draft
huntie wants to merge 1 commit into
mainfrom
pr60592
Draft

huntie wants to merge 1 commit into
mainfrom
pr60592

Conversation

@huntie

@huntie huntie commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Summary

A <ScrollView> with contentInsetAdjustmentBehavior set to automatic or always can draw its first frame without its safe area padding, then lay out again a frame later. On the unfolded iPhone Duo, text in a scroll view under the rail draws beneath the status items for one frame, then rewraps clear of them. The padding reaches the content container through a ScrollContentView state update, which is asynchronous and can land after that frame is presented.

#60116 added enableImmediateUpdateModeForScrollContentView, which applies that update synchronously on the main thread, so the padded layout mounts in the same frame. The fix is immediately useful, and the jump it removes is noticeable: text visibly rewraps as the screen appears, and in RNTester 4 in 10 mounts drew the unpadded frame.

This diff turns it on in every open source release. The flag moves to the stable release stage, and the OSS stable overrides on iOS and Android set it to true, which canary and experimental inherit. The default stays false, so the internal rollout is unaffected.

  • The synchronous commit runs when a scroll view's safe area padding or content inset adjustment changes, such as on mount or rotation, not on scroll.
  • Only iOS reads the flag; Android's stable override keeps the OSS value the same on both platforms.

Changelog:
[iOS][Fixed] - ScrollView: Apply safe area content padding in the first frame a scroll view draws, not one frame later

Test Plan

  • yarn featureflags --verify-unchanged and yarn test packages/react-native/src/private/featureflags pass.
  • yarn format-check-cpp and yarn format-check-kotlin pass.

RNTester on the unfolded iPhone Duo simulator (iOS 27.2). A temporary example remounts a <ScrollView contentInsetAdjustmentBehavior="automatic"> of long, right-aligned text every 1.5 s, in a full-screen <Modal> so it spans the rail. The same build ran with the update asynchronous and with it forced synchronous, and each run was recorded with simctl io recordVideo at 60 fps:

  • ✅ Asynchronous: 4 of 10 mounts drew a frame with the text under the rail, then rewrapped.
  • ✅ Synchronous: 0 of 10. Every mount drew its final layout in its first frame.
  • ✅ The same change, patched into an app on 0.89.0-rc.4, removed the frame from 10 of 10 remounts of a scroll view under the rail.
First frame, asynchronous First frame, synchronous
duo-unfolded-scrollview-mount-before-first-frame duo-unfolded-scrollview-mount-after-first-frame

Frame by frame at 3 fps, around one mount:

duo-unfolded-scrollview-mount-slowed.mp4

Note

Window captures drop single frames, so each still places the recorded device frame in a Device Hub window capture of the same simulator.

@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant