The functionality of the resetScroll property of the Link component is reversed. When it is set to false, it resets to `0,0`.
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
- Check if resetScroll in the code is false, and first scroll in the home for a while.
- Click on "about", then click on "home" again, and you'll find that the home has been reset.
- 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
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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