Skip to content

Fix scroll restore for first timeline item#2933

Open
nepenth wants to merge 1 commit into
cinnyapp:devfrom
nepenth:fix-scroll-restore-anchor-zero
Open

Fix scroll restore for first timeline item#2933
nepenth wants to merge 1 commit into
cinnyapp:devfrom
nepenth:fix-scroll-restore-anchor-zero

Conversation

@nepenth
Copy link
Copy Markdown

@nepenth nepenth commented May 9, 2026

Summary

Fixes a scroll restoration edge case in useVirtualPaginator where timeline item index 0 was treated as missing because the anchor check used a generic falsy test.

When the restore anchor is the first rendered item, anchorItem is 0. The previous condition returned undefined, so pagination could skip scroll restoration for that valid anchor.

Change

  • Treat only non-number anchor indexes as missing.
  • Preserve 0 as a valid restore anchor.

Validation

  • npm ci
  • npx eslint src/app/hooks/useVirtualPaginator.ts
  • git diff --check

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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