Repository navigation
Conversation
6c44668 to
6b290c9
Compare
| * the content container by the insets, so content is laid out clear of the | ||
| * system UI, such as the rail on iPhone Duo or camera cutout in landscape, | ||
| * while the container's background still extends edge to edge. | ||
| * while the container's background still extends edge to edge. On every |
There was a problem hiding this comment.
Nit: The docs say contentContainerStyle padding counts toward the inset “on every edge,” but percentage padding intentionally bypasses this calculation. Could we qualify this as point-valued padding or mention the percentage-padding exception?
There was a problem hiding this comment.
Yeah let me follow this up 👍🏻👍🏻
There was a problem hiding this comment.
Thanks for adding the detailed percentage-padding behavior below — that addresses the underlying nuance. One small follow-up: this sentence still says the padding counts toward the inset “on every edge,” which remains slightly over-broad because percentage padding across the scrollable axis intentionally bypasses the safe-area padding. Could we qualify this sentence as point-valued/pixel padding too?
cipolleschi
left a comment
There was a problem hiding this comment.
Looks good overall. The inset calculation, RTL handling, native state propagation, and test coverage are sound. I left one non-blocking documentation nit.
|
@huntie-bot Pick to 0.89 and 0.88 when merged. Assume #59194 is successfully picked first, by explicitly stating this dependency in the pick request with an |
Pull Request is not mergeable
|
Just to set expectations, we can't pick these changes in 0.88 because it will be a breaking change. |
Summary
Context
Optional but intended follow-up to #59194.
#59194 fixed the documented behaviour of
ScrollView/FlatListcontentInsetAdjustmentBehaviorby handling safe area padding across the scrollable axis, such as the rail on iPhone Duo and the notch on a regular iPhone in landscape.Now that this works, there's a further detail on Duo which reveals a bug/misbehaviour with
contentInsetAdjustmentBehaviorhandling and inner content padding.This diff
Proposes a further update to
contentInsetAdjustmentBehaviorand how it interacts with padding set bycontentContainerStyle.Key change: Moves from an add padding approach to max of padding or safe area, per edge.
Illustrated — ScrollView with 20px content padding all sides +
contentInsetAdjustmentBehavior="auto"The aim is to make React Native's scroll views work intuitively.
Implementation notes
Changelog:
[iOS][Fixed] - ScrollView:
contentInsetAdjustmentBehaviornow pads content by the larger of the safe area orcontentContainerStylepadding. Previously, it added the two.Test Plan
RNTester, ScrollView > Content Inset Adjustment Behavior