router icon indicating copy to clipboard operation
router copied to clipboard

Page doesn't scroll to top after navigation

Open tien opened this issue 9 months ago • 4 comments

I'm still trying to create a minimum reproduction for this.

Current behaviour:

  • By default scroll does not get reset to top after navigation
  • Setting scrollRestoration: true doesn't works correctly with router.history.back()

tien avatar Mar 18 '25 12:03 tien

Similar to #3680

Working Solution for now is to roll back to @tanstack/[email protected]

JoshuaHD avatar Mar 20 '25 02:03 JoshuaHD

I'm having a similar issue with this on Safari only, not chrome. Not sure if related.

Benjamin-Lee avatar Mar 23 '25 07:03 Benjamin-Lee

I'm experiencing the same issue across all browsers with @tanstack/[email protected]. For what it's worth, enabling scrollRestoration: true seems to make navigation scroll to the top of each page, and it works as intended when going back in history.

dcantelmo avatar Apr 10 '25 13:04 dcantelmo

@tien does this issue still exist? if yes, can you please share a reproducer?

schiller-manuel avatar Jun 13 '25 19:06 schiller-manuel

I'm getting the same issue on my personal website. Occurs only on iPhone Github repo: https://github.com/Steffan-Harris/steffan.lol URL: https://www.steffan.lol/

Steps to reproduce: Scroll down the homepage and navigate to "about" from the homepage

Steffan-Harris avatar Sep 12 '25 16:09 Steffan-Harris

@Steffan-Harris could not reproduce this on an iPhone with safari 17.6. which version of safari do you experience this issue with?

schiller-manuel avatar Sep 21 '25 13:09 schiller-manuel