The page is not started at the top when navigating to a page that uses @tanstack/virtual >= v3.0.0-beta.61

Open
#646 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with the minimal reproducible example in the linked CodeSandbox, especially app/page.tsx, and reproduce the navigation after scrolling down. Compare behavior with @tanstack/virtual versions before and from v3.0.0-beta.61, using the linked upstream pull request as context. Done means navigating to Dashboard starts the page at the top.

Written by the indexing model from the issue text.

Description

Describe the bug

The page is not started at the top when navigating to a page that uses @tanstack/virtual >= v3.0.0-beta.61.
It looks like this commit is the problem: https://github.com/TanStack/virtual/pull/592

Your minimal, reproducible example

https://codesandbox.io/p/devbox/next-js-react-virtual-wzxqt4?file=%2Fapp%2Fpage.tsx

Steps to reproduce
  1. Scroll Down
  2. click to link Dashboard
  3. BUG: the page is not started from the top
Expected behavior

the page should be started at the top.

https://github.com/TanStack/virtual/assets/300961/28c8ddb0-5f9a-48ec-beca-c9e1a88931d6

How often does this bug happen?

None

Screenshots or Videos

No response

Platform
  • Linux, macOS
  • Chrome
tanstack-virtual version

= v3.0.0-beta.61

TypeScript version

5.2.2

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Dominant language
TypeScript
Stars
7.2k
Forks
495
Avg merge
23h 16m
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TanStack/virtual

All issues in TanStack/virtual

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.