Repository navigation
Conversation
3 tasks
huntie
marked this pull request as ready for review
October 19, 2026 15:13
…al safe area (iPhone Duo)
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
<ScrollView>'scontentInsetAdjustmentBehaviorprop provides built-in safe area handling today on the vertical axis (e.g. above the home indicator), however is missing safe area handling on the cross axis (i.e. iPhone Duo vertical rail).Since #58109 (
experimental_onSafeAreaInsetsChange), we now have the API to conveniently patch this behaviour in core.From the user's perspective
This presents a very frequent code authoring issue.
Typical ScrollView code at the top of a layout today (e.g. app screen in Expo Router):
Without this diff, needs to become:
⬆️
contentInsetAdjustmentBehavior="automatic"isn't doing its job on the horizontal safe areas on a device such as iPhone Duo.With this diff the scroll view handles it alone:
automatic)And the code sample becomes resolved:
ScrollView-only hierarchy — backwards compatible ✅Why this is a bug
Remember that:
<ScrollView contentInsetAdjustmentBehavior="automatic">already handles the bottom safe area inset on relevant devices.And again, with iOS 27.1 and iPhone Duo, a typical React Native screen with a
<ScrollView>(e.g. in Expo Router) that handled safe area before, does not work now. This is a combination of:"automatic"should be automatic. By fixing this we delete the problem for all RN users.Changes
ScrollViewobserves its own safe area when the behavior is not'never'and pads the content container across the scrollable axis, on top of the padding its style resolves to on that edge.'always', thecontentInsetpassed to native subtracts the safe area across the scrollable axis, so UIKit's content inset there nets to the caller's own and the safe area applies once.Impact
Notes
Changelog:
[iOS][Fixed] - ScrollView:
contentInsetAdjustmentBehaviorkeeps content clear of the safe area across the scrollable axis, such as the rail on iPhone Duo and the notch in landscapeTest Plan
RNTester on an iPhone Duo simulator (iOS 27.1), ScrollView > Content Inset Adjustment Behavior, which opens a full screen modal:
iPhone 18 Pro simulator (iOS 27.0) in landscape, the same example. Both sides carry a safe area inset here, the camera cutout side and the opposite edge:
automatic)neverdoesNesting the layout with
<SafeAreaView>(backwards compatible)Build with a temporary toggle added in the example that wraps the rows in
react-native-safe-area-context'sSafeAreaView, with a yellow background (today's temporarily necessary authoring behaviour):automaticselected.