Repository navigation
Conversation
…vigation and tab bars
Collaborator
Author
Alternative: Simplify and just handle the cross axis instead?The result we've ended up with is now similar to simply scoping down our Duo-intended padding additions to the cross-axis only — and we could consider narrowing/reverting. Counterpoints:
System bars are an extension of the insets problem we were already solving — just a special case which I missed until this was tested in a real app. |
Collaborator
Author
|
I might want to rephrase the doc comments tomorrow for clarity, but opening for review first. |
huntie
marked this pull request as ready for review
November 19, 2026 21:16
|
Open pick requests to 0.88 for the ScrollView stack of changes were closed. We're focusing on holistically shipping this + blog post comms in 0.89. |
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
Context
Follow-up to #59836, which is on
0.89-stable.Problem
With
contentInsetAdjustmentBehavior, #59836 lays out each edge at the larger of thecontentContainerStylepadding and the safe area inset.This is ideal for iPhone Duo / iPhone landscape horizontal insets. However, for the scrollable axis (when vertical), UIKit's inset also covers any system navigation bar, tab bar or toolbar the scroll view sits under. In this case, absorbing padding smaller than the bar is unexpected — a screen under a native stack header (react-native-screens, Expo Router) or above a tab bar loses its top or bottom padding.
(Below image is a mock explainer):
This diff
Apply the larger-of rule along the scrollable axis only on an edge where the window's safe area (the status bar, sensor housing or home indicator) alone makes up the inset. Where a bar adds to it, the padding adds on top, as in earlier releases:
automaticPhrased another way: Auto-positioning under a system header turns off inset vs padding behaviour. For vertical, this would now only take effect for a full screen view.
ScrollViews not against the system edges (e.g. already in a SafeAreaView or under an opaque custom header), are unchanged.
Changes
contentInsetAdjustmentBehaviorandcontentContainerStyledocs to match.Changelog:
[iOS][Fixed] - ScrollView: With
contentInsetAdjustmentBehavior,contentContainerStylepadding adds to an inset that includes a navigation bar, tab bar or toolbar, instead of being absorbed by itTest Plan
Set up temporarily in RNTester: the full screen ScrollView example under a native navigation bar, with 20 pt padding (green).
(Ignore white gap above the navigation bar, this is a separate Duo bug.)
RCTScrollViewComponentView.mmcompiles in an RNTester simulator build.ScrollContentViewTest.cpp: addedkeepsColumnPaddingBelowANavigationBar.