Skip to content

fix(core): ios scroll-view ignores the content inset UIKit adds - #16

Merged
farfromrefug merged 1 commit into
mainfrom
fix/ios-scrollview-adjusted-inset
Nov 10, 2026
Merged

farfromrefug merged 1 commit into
mainfrom
fix/ios-scrollview-adjusted-inset

Conversation

@farfromrefug

Copy link
Copy Markdown

Summary

  • 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: a content that fits could still scroll by the top + bottom inset (large title, toolbar).
  • onLayout now follows the native behavior instead of the property, and subtracts adjustedContentInset from the viewport used for contentSize and the child.
  • scrollViewDidChangeAdjustedContentInset requests a layout when UIKit changes the inset and the content fits.

Testing

  • Checked in the iOS 27 simulator with a pushed page (large title + bottom toolbar): a short content no longer scrolls, and a long content still scrolls to its end with the title collapsing.
  • Not run: the core unit tests. A visual check on other scroll views with iosContentInsetAdjustmentBehavior set is still welcome.

🤖 Generated with Claude Code

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>
@farfromrefug
farfromrefug marked this pull request as ready for review November 10, 2026 11:07
@farfromrefug
farfromrefug merged commit f346a47 into main Nov 10, 2026
1 of 2 checks passed
@farfromrefug
farfromrefug deleted the fix/ios-scrollview-adjusted-inset branch November 10, 2026 11:07
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.

1 participant