Skip to content

Fix targetContentOffsetAnchor calculation#150

Merged
bryankeller merged 1 commit intomasterfrom
bk/fix-target-content-offset-large-items
Nov 19, 2025
Merged

Fix targetContentOffsetAnchor calculation#150
bryankeller merged 1 commit intomasterfrom
bk/fix-target-content-offset-large-items

Conversation

@bryankeller
Copy link
Contributor

This fixes an edge case with targetContentOffsetAnchor - if all visible item are partially off screen, then we fell into a guard that returned a targetContentOffsetAnchor of .top or .bottom, causing the collection view to scroll all the way to the top or bottom edge.

We need to handle this case, since and fallback to the first / last visible item if there are no "fully-visible" items.

@bryankeller bryankeller added the bug Something isn't working label Nov 19, 2025
@bryankeller bryankeller merged commit ae34a35 into master Nov 19, 2025
1 check passed
@bryankeller bryankeller deleted the bk/fix-target-content-offset-large-items branch November 19, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants