fix(ios): default contentInsetAdjustmentBehavior to scrollableAxes on iOS 26+#57300
Open
IsaacIsrael wants to merge 1 commit into
Open
fix(ios): default contentInsetAdjustmentBehavior to scrollableAxes on iOS 26+#57300IsaacIsrael wants to merge 1 commit into
IsaacIsrael wants to merge 1 commit into
Conversation
… iOS 26+ On iOS 26+, Apple introduced the liquid glass design language with translucent system chrome (tab bars, toolbars). Scroll views need contentInsetAdjustmentBehavior set to scrollableAxes to automatically adjust content insets for this translucent chrome. This change upgrades the default from "never" to "scrollableAxes" on iOS 26+ when UIDesignRequiresCompatibility is not YES, affecting: - RCTEnhancedScrollView initWithFrame: - RCTScrollViewComponentView updateProps: (upgrades JS default "never") - RCTScrollViewComponentView prepareForRecycle Apps that explicitly set contentInsetAdjustmentBehavior to "automatic", "always", or "scrollableAxes" from JS are unaffected. Apps with UIDesignRequiresCompatibility=YES retain the current "never" default. Fixes react#57299 Co-authored-by: Cursor <cursoragent@cursor.com>
| auto contentInsetAdjustmentBehavior = newScrollViewProps.contentInsetAdjustmentBehavior; | ||
| if (@available(iOS 26, *)) { | ||
| NSNumber *compat = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIDesignRequiresCompatibility"]; | ||
| if (!compat.boolValue && contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Never) { |
Contributor
There was a problem hiding this comment.
On iOS 26 without UIDesignRequiresCompatibility, this upgrades Never to ScrollableAxes whenever the value is Never. The prop arrives as Never both for the RN default and when a developer explicitly sets contentInsetAdjustmentBehavior="never", so this overrides an explicit "never" too.
The effect is that there is no per-view way to keep never on iOS 26 now, just the app-wide UIDesignRequiresCompatibility opt-out.
Is overriding an explicit "never" intended? If someone wants no inset adjustment on a specific scroll view on iOS 26, how would they express it? The prop does not seem to carry whether the value was explicit, so maybe there is no clean per-view fix. Wanted to check the intent.
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
On iOS 26+, Apple introduced the liquid glass design language with translucent system chrome (tab bars, toolbars, navigation bars). For scroll views to properly adjust their content to account for this translucent chrome,
contentInsetAdjustmentBehaviorshould default toUIScrollViewContentInsetAdjustmentScrollableAxesinstead ofUIScrollViewContentInsetAdjustmentNever.This PR upgrades the default on iOS 26+ when
UIDesignRequiresCompatibilityis notYESin Info.plist, in three places:RCTEnhancedScrollView.mminitWithFrame:— defaults toscrollableAxesinstead ofneverRCTScrollViewComponentView.mmupdateProps:— upgrades incoming JS defaultnevertoscrollableAxesRCTScrollViewComponentView.mmprepareForRecycle— resets toscrollableAxesinstead ofneverBehavior Matrix
never(unchanged)YESnever(unchanged)NOor absentscrollableAxes(new)Apps that explicitly set
contentInsetAdjustmentBehaviorto"automatic","always", or"scrollableAxes"from JS are unaffected.Changelog:
[IOS] [FIXED] - Default
contentInsetAdjustmentBehaviortoscrollableAxeson iOS 26+ for liquid glass translucent chrome supportTest Plan:
UIDesignRequiresCompatibilityfrom Info.plist (or set toNO)FlatListinside a screen with a translucent bottom tab bar (drawBehind: true)neverdefault)UIDesignRequiresCompatibility = YESkeepsneverdefault on iOS 26+Fixes #57299