TanStack / TanStack/router

The functionality of the resetScroll property of the Link component is reversed. When it is set to false, it resets to `0,0`.

Open
#6,135 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Router

Describe the bug

The functionality of the resetScroll property of the Link component is reversed. When it is set to false, it resets to 0,0.

Your Example Website or App

https://github.com/abeixiaolu/tanstack-admin

Steps to Reproduce the Bug or Issue
  1. Check if resetScroll in the code is false, and first scroll in the home for a while.
  2. Click on "about", then click on "home" again, and you'll find that the home has been reset.
  3. Set it to true, then repeat the above process, and the home scroll will not be reset.
Expected behavior

When set to true, it returns to the position (0,0). When set to false, it retains the scroll position.

Screenshots or Videos

https://github.com/user-attachments/assets/79c9712c-973c-4591-9a77-f2dcbcea6731

Platform
Image
Additional context

No response

Contributor guide

Open the contributing guide

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.

Research direction

Start with the Router Link component and reproduce the reported navigation sequence using the example app. Trace how resetScroll is handled for true and false, then verify that true returns to (0,0) while false preserves the previous scroll position.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.