Repository navigation
Conversation
|
@huntie-bot If merged before Monday, pick to 0.88 and 0.89 — again citing via an |
|
@cipolleschi Updated, thanks |
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for this! A few comments inline.
The PR also needs a rebase on top of main before it can land.
One more outside the diff: the safeAreaPadding comment in packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollContentViewState.h still says the enclosing scroll view sets the pair of edges across its scrollable axis, unconditionally. You updated the matching comment in RCTScrollContentViewComponentView.h to "automatic or always"; could you update this one as well so the two layers agree?
| if (props.contentInsetAdjustmentBehavior != ContentInsetAdjustmentBehavior::Never) { | ||
| UIEdgeInsets insets = self.safeAreaInsets; | ||
| UIEdgeInsets adjusted = _scrollView.adjustedContentInset; | ||
| UIEdgeInsets current = _scrollView.contentInset; |
There was a problem hiding this comment.
Not introduced by this PR, but more likely to be hit now that 'scrollableAxes' is the suggested opt-out: under 'scrollableAxes' (and 'automatic'), UIKit only applies adjustedContentInset along the axis while it considers the axis scrollable. Absorbing the padding shrinks the content, which can make it fit, so UIKit drops the inset, the padding comes back, and the content becomes scrollable again.
With alwaysBounceVertical={false} and content just taller than the bounds, this can keep flipping through scrollViewDidChangeAdjustedContentInset / layoutSubviews state updates. Could you take a look, or open a follow-up issue to track it?
There was a problem hiding this comment.
I see. This seems to happen when padding absorption makes the content just fit, but it predates this PR: the same inset and padding interaction is already in automatic mode on main. We can look at this separately?
|
@huntie-bot Rebase and address comments. |
|
Decision logged: @huntie decided (13 Nov 2026) to keep the current |
Summary
Context
Follow-up to #59194, which pads the content container across the scrollable axis for every
contentInsetAdjustmentBehaviorexcept'never'.Motivation
Before this diff,
'automatic'and'scrollableAxes'did the same thing. UIKit's.automaticdiffers from.scrollableAxesonly by a backward-compatibility rule tied toautomaticallyAdjustsScrollViewInsets, deprecated since iOS 11.This diff
Pad across the scrollable axis for
'automatic'and'always'only, so'scrollableAxes'applies the safe area insets along the scrollable axis alone, as its name and UIKit's.scrollableAxessay.'never''scrollableAxes''automatic''always''scrollableAxes'uses UIKit's.scrollableAxesfor the along-axis inset, and is the opt-out for apps that handle the side insets themselves (no React Native cross-axis padding). Point-valuedcontentContainerStylepadding is still absorbed on edges where UIKit applies an inset.contentInsetAdjustmentBehaviordocs now describe each value.Changelog:
[Internal] - Narrows the cross-axis padding from #59194 to
'automatic'and'always'before releaseTest Plan
RNTester, ScrollView > Content Inset Adjustment Behavior, full screen modal, switching the behavior with the buttons at the top. Before is #59836; after is this PR, both built from source. These are unframed simulator captures.
scrollableAxes, beforeautomatic.scrollableAxesscrollableAxes, beforeautomaticalwaysℹ️ Switching between the values on a running screen updates the layout in both directions.