Repository navigation
fix(core): ios scroll-view ignores the content inset UIKit adds - #16
Merged
Merged
Conversation
A scroll view whose native contentInsetAdjustmentBehavior is set by a plugin (the app bar pins its scroll target with Automatic) kept the `never` property: the layout used the safe area and contentSize = viewport, then UIKit added its adjusted inset on top, so a content that fits could still scroll by the inset. - follow the native behavior instead of the property to know UIKit adjusts the inset - subtract adjustedContentInset from the viewport used for contentSize and the child - request a layout when UIKit changes the inset and the content fits Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
contentInsetAdjustmentBehavioris set by a plugin (the app bar pins its scroll target withAutomatic) kept theneverproperty. The layout used the safe area andcontentSize = viewport, then UIKit added its adjusted inset on top: a content that fits could still scroll by the top + bottom inset (large title, toolbar).onLayoutnow follows the native behavior instead of the property, and subtractsadjustedContentInsetfrom the viewport used forcontentSizeand the child.scrollViewDidChangeAdjustedContentInsetrequests a layout when UIKit changes the inset and the content fits.Testing
iosContentInsetAdjustmentBehaviorset is still welcome.🤖 Generated with Claude Code