Skip to content

[ScrollView][iOS] Restore previous padding behaviour under navigation and tab bars - #60163

Open
huntie wants to merge 1 commit into
mainfrom
pr60163
Open

huntie wants to merge 1 commit into
mainfrom
pr60163

Conversation

@huntie

@huntie huntie commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Context

Follow-up to #59836, which is on 0.89-stable.

Problem

With contentInsetAdjustmentBehavior, #59836 lays out each edge at the larger of the contentContainerStyle padding 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):

Mock of iPhone Duo under a solid header: in 0.89.0-rc the list sits flush against the header, with this diff it sits 16 pt below

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:

Vertical ScrollView, automatic 0.88 0.89.0-rc This diff
Full screen under dynamic island only, 16 pt padding 59 + 16 ⚠️ larger of the two ✅ larger of the two
Under a navigation bar, 16 pt padding bar + 16 bar + 0 ❌ ✅ bar + 16
Above a tab bar bar + padding absorbed ❌ ✅ bar + padding
Above the home indicator only 34 + padding ⚠️ larger of the two ✅ larger of the two
Beside the iPhone Duo side bar, 16 pt padding 16, under the side bar ❌ larger of the two ✅ larger of the two
iPhone in landscape, beside the Dynamic Island, 16 pt padding inset + 16 ❌ larger of the two ✅ larger of the two

Phrased 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

  • Across the scrollable axis, unchanged: the larger of the padding and the whole safe area, such as the side bar on iPhone Duo.
  • Clarify the contentInsetAdjustmentBehavior and contentContainerStyle docs to match.

Changelog:
[iOS][Fixed] - ScrollView: With contentInsetAdjustmentBehavior, contentContainerStyle padding adds to an inset that includes a navigation bar, tab bar or toolbar, instead of being absorbed by it

Test 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.)

iPhone Duo folded, before after
❌ The navigation bar inset absorbs the padding, so the content sits flush against the bar ✅ The 20 pt padding adds below the bar
  • RCTScrollViewComponentView.mm compiles in an RNTester simulator build.
  • ScrollContentViewTest.cpp: added keepsColumnPaddingBelowANavigationBar.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 19, 2026
@huntie huntie changed the title [ScrollView][iOS] Fix contentContainerStyle padding absorbed under navigation and tab bars [ScrollView][iOS] Restore previous contentContainerStyle padding under navigation and tab bars Nov 19, 2026
@huntie

huntie commented Nov 19, 2026 •

Copy link
Copy Markdown
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:

  • Inconsistency (once this model is understood). We ignore fixing the (rare) full screen behaviour / iPhone Duo alignment for horizontal scrollviews.
  • Makes the existing contentInsetAdjustmentBehavior="scrollableAxes" prop redundant — we'd basically want the inverse design (breaking change).

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.

@huntie

huntie commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

I might want to rephrase the doc comments tomorrow for clarity, but opening for review first.

@huntie
huntie marked this pull request as ready for review November 19, 2026 21:16
@huntie huntie changed the title [ScrollView][iOS] Restore previous contentContainerStyle padding under navigation and tab bars [ScrollView][iOS] Restore previous padding handling under navigation and tab bars Nov 19, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 19, 2026
@huntie huntie changed the title [ScrollView][iOS] Restore previous padding handling under navigation and tab bars [ScrollView][iOS] Restore previous padding behavior under navigation and tab bars Nov 19, 2026
@huntie huntie changed the title [ScrollView][iOS] Restore previous padding behavior under navigation and tab bars [ScrollView][iOS] Restore previous padding behaviour under navigation and tab bars Nov 19, 2026
@huntie-bot

Copy link
Copy Markdown

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

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants