Hash history router doesn't scroll to top when visiting a new page
Which project does this relate to?
Router
Describe the bug
When using hash history via createHashHistory, navigation to new pages doesn't scroll to the top of the page. Instead it seems to keep the scroll position from the original page.
Your Example Website or App
https://stackblitz.com/edit/github-4rybtq-5mekkq2j?file=src%2Froutes%2Findex.tsx,src%2Froutes%2Fabout.tsx,src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
- Scroll down
- Click on "Go to about"
- Confirm that you are in a scrolled state
Expected behavior
As a user, I expect to go to the top of /about when I haven't been there before. Instead I end up scrolled to the middle of the page.
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Arc
- Version: Chromium Engine Version 133.0.6943.35
Additional context
The incorrect behaviour is only visible when using "hash history". When using default browser history the navigation behaves as expected.
Had to revert #3700 in #3702 due to an unintended bug that it introduced in Start.
@SeanCassiere Do you have any updates about when this might get merged again?
Thanks for the fix!