Skip to content

feat(ios): iosContentInsetAdjustmentBehavior for ScrollView with safe-area aware layouts - #11324

Open
NathanWalker wants to merge 2 commits into
mainfrom
feat/ios-scrollview-inset-behavior
Open

feat(ios): iosContentInsetAdjustmentBehavior for ScrollView with safe-area aware layouts#11324
NathanWalker wants to merge 2 commits into
mainfrom
feat/ios-scrollview-inset-behavior

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

Adds an iOS-only iosContentInsetAdjustmentBehavior property to ScrollView (mapping to UIScrollView.contentInsetAdjustmentBehavior, default never to preserve existing behavior). When iOS manages insets, ScrollView no longer subtracts safe-area insets manually (avoiding scroll drift with large titles) and nested layouts (Absolute, Dock, Flexbox, Grid, Stack, Wrap) skip their own safe-area subtraction via IOSHelper.hasIOSManagedInsetAncestor to prevent double-counting the nav-bar inset.

…-area aware layouts

Adds an iOS-only `iosContentInsetAdjustmentBehavior` property to ScrollView
(mapping to UIScrollView.contentInsetAdjustmentBehavior, default `never` to
preserve existing behavior). When iOS manages insets, ScrollView no longer
subtracts safe-area insets manually — avoiding scroll drift with large titles —
and nested layouts (Absolute, Dock, Flexbox, Grid, Stack, Wrap) skip their own
safe-area subtraction via IOSHelper.hasIOSManagedInsetAncestor to prevent
double-counting the nav-bar inset.
@NathanWalker NathanWalker added this to the 9.1 milestone Aug 1, 2026
@nx-cloud

nx-cloud Bot commented Aug 1, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 2e9a3ab

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 30s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-03 20:49:46 UTC

Comment thread packages/core/ui/scroll-view/scroll-view-common.ts Outdated
Comment thread packages/core/ui/scroll-view/index.ios.ts Outdated
Comment thread packages/core/ui/scroll-view/index.ios.ts
Comment thread packages/core/ui/scroll-view/scroll-view-common.ts Outdated
…-area skip

- apply contentInsetAdjustmentBehavior through the property's setNative
  (runtime changes now take effect) instead of on every onLayout pass
- move the managed-inset ancestor check into View.getSafeAreaInsets so
  layouts no longer repeat it individually
- only request layout on Apple platforms (affectsLayout: __APPLE__)
@NathanWalker
NathanWalker force-pushed the feat/ios-scrollview-inset-behavior branch from 2e9a3ab to 8a7d94f Compare August 3, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants