Repository navigation
Conversation
A scroll to a row or to the end, asked in the same update as rows inserted, removed or measured above the viewport, landed shifted by those rows: updateList added what they moved into anchor, and the anchoring ItemScrollBy went out after the jump's ItemScrollTo, so the platform applied both. The jump sets the offset outright from the new sizes, so it now drops the anchor, as it already drops a pending retarget. Fixes nsgo-dev#1019
4 of 14 tasks
This branch has not been deployed
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
Fixes #1019.
A scroll to a row (
Ref.ScrollToIndex,Ref.ScrollToIndexAt) or to the end (Ref.ScrollToEnd), asked in the same update as rows inserted, removed or measured above the viewport, landed off its target by those rows.updateListadded what they moved intoanchor, and the anchoringItemScrollBywent out after the jump'sItemScrollTo, so the platform applied both. The jump sets the offset outright from the new sizes, so it now drops the anchor, as it already drops a pendingretarget.core/list.go: the scroll commands resetanchoralong withretarget.core/list_test.go:TestKeyedListJumpsToARowInsertedAboveTheViewportinserts a row above the viewport and jumps to it in one update, animated and not. It fails on main withthe inserted row is -40 from the viewport's start, want 0andoffset 840, want 800.CHANGELOG.md: anUnreleasedline.Targets
core,base,ui,tsx, thensgotool)Screenshots
None.
Verification
go tool nsgo test -run '^TestKeyedListJumpsToARowInsertedAboveTheViewport$' ./corefails on main at4b3a9f7cand passes with this change, three runs out of three.go tool nsgo checkon Linux x86_64 (the host): passes.go tool nsgo teston Linux x86_64 under Xvfb (GDK_BACKEND=x11,GSK_RENDERER=cairo, a private D-Bus session and a temporary HOME): 3,075 passed, 8 failed, 59 skipped. Main at4b3a9f7cin the same environment: 3,074 passed, with the same 8 failing.TestAccessibilitySelectedAndExpandedReachATSPI: no AT-SPI registry.TestVideoShowsWhatIsBehindItsTransparentPixels: no GStreamer plug-in for the alpha video.TestInstance*: the run's longTMPDIRpushed their socket paths past the address limit. All six pass three times out of three with a short one.-targettests, as nothing here is backend-specific; Windows, web and Apple's mobile targets.Checklist
fix(linux): keep the caret after a paste; a squash merge uses it as the commit subject.CHANGELOG.md'sUnreleasedhas a line for a capability users can see.