Repository navigation
Conversation
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
A
<ScrollView>withcontentInsetAdjustmentBehaviorset toautomaticoralwayscan 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 aScrollContentViewstate 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
stablerelease stage, and the OSS stable overrides on iOS and Android set it totrue, which canary and experimental inherit. The default staysfalse, so the internal rollout is unaffected.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-unchangedandyarn test packages/react-native/src/private/featureflagspass.yarn format-check-cppandyarn format-check-kotlinpass.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 withsimctl io recordVideoat 60 fps: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.