Repository navigation
zero-swift: a list stuck to the bottom takes the user's first scroll - #30
Merged
Merged
Conversation
…roll When the core scrolled a host to where the host clamped it, no didScroll followed, so programmaticScroll stayed set and the user's next scroll was taken for the core's own: stuck wasn't measured again, and the list pulled the rows back to the bottom against the scroll. setScrollOffset now clears the flag when the host didn't move. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
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.
In a
VirtualListorVirtualListViewwithstickToBottom, the user's first scroll up could be pulled back to the bottom.Cause:
VirtualizerCore.setScrollOffsetsetsprogrammaticScrollbefore asking the host to scroll. When the host clamps the target to where it already is, as on a scroll past the bottom of a list opened at its last row, nodidScrollfollows, so the flag stays set. The user's next scroll is then taken for the core's own:stuckisn't measured again, and the re-pin pulls the rows back against the scroll.Fix:
setScrollOffsetclears the flag and returns false when the host didn't move.Found while investigating a one-frame wrong move in the iPhone chat frame probe on #29. It's the likely cause of that failure, but that isn't proven. The bug is on main and in 0.4.4, so it ships separately.
Checks (Linux): Swift 216 tests in 41 suites, also under
ulimit -s 512; strict lint. The new LayoutHost test fails without the fix (the row ends at −16.1 instead of moving 20.5 pt) and passes with it. On macOS, ZeroVirtualTests 101/101 and AppleTests VirtualList/VirtualListView 8/8 passed with the fix.