Skip to content

fix: anchor data changes that arrive during a scroll-jump reset - #598

Open
chrispader wants to merge 1 commit into
LegendApp:mainfrom
chrispader:fix/anchor-data-after-scroll-jump
Open

chrispader wants to merge 1 commit into
LegendApp:mainfrom
chrispader:fix/anchor-data-after-scroll-jump

Conversation

@chrispader

Copy link
Copy Markdown

After a large scroll jump, such as a fast scrollbar drag, LegendList lets newly measured items reposition without an anchor until it has measured every item it rendered since the jump. If new data arrives during that window, the measurements of the new items push the visible items by a few hundred pixels for a frame. With this change, a data change clears that state when maintainVisibleContentPosition covers data changes, so the new items are anchored like any other data change.

We hit this in Expensify/App#100733, which moves the chat message list to LegendList. Dragging the scrollbar quickly to the top of a long chat makes the visible messages jump when the next page of older messages loads. Expensify currently carries this fix as a patch.

Reproduction

  1. On web, render a long list with maintainVisibleContentPosition and estimated item sizes.
  2. Drag the scrollbar thumb quickly up and down, then hold it near the top.
  3. Prepend a page of items before the list has measured the region you jumped to.
  4. Verify the items on screen do not move.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T20:45:13.348588Z
We couldn’t complete this review. Comment @codex review to try again.
407e7dc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

After a large scroll jump, userScrollAnchorReset lets newly measured items
reposition without an anchor until every item rendered since the jump is
measured. When new data arrived in that window, the measurements of the new
items pushed the visible items by a few hundred pixels for a frame.

checkResetContainers now clears the reset when maintainVisibleContentPosition
covers data changes, so the new data is anchored like any other data change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chrispader
chrispader force-pushed the fix/anchor-data-after-scroll-jump branch from 407e7dc to 823e44b Compare November 9, 2026 10:53
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