Skip to content

[Router] - Page briefly jumps to the top before restoring scroll on reload #8502

Closed

Description

@Andresuito

Which project does this relate to?

Router

Describe the bug

When reloading a page after scrolling down, the page briefly jumps to the top and then returns to the position where it was reloaded.

The final scroll position is correct. The problem is the visible jump before restoration completes. I observe this in Chrome and Safari, including when running this minimal example in development mode. It can be intermittent, so repeated reloads may be necessary.

Complete minimal reproducer

https://github.com/Andresuito/tanstack-scroll-repro

Steps to Reproduce the Bug

  1. Start the application with pnpm dev and open the URL printed by Vite in Chrome or Safari.
  2. Scroll down to approximately section 10.
  3. Wait a moment, then reload the page with Command + R on macOS.
  4. Watch the page briefly show the pink header at the top before returning to the previous scroll position.
  5. Repeat the reload several times if it does not happen initially. Also try a hard reload (Command + Shift + R in Chrome), and specify which reload method is shown in the attached video.

Expected behavior

Reloading should preserve the previous scroll position without visibly jumping to the top first.

Screenshots or Videos

prod.mov

Second 0:13 (Second video)

example-dev.mov
tanstack.web.mov

Platform

  • Router version: @tanstack/react-router 1.170.39
  • Start version: @tanstack/react-start 1.168.58
  • OS: macOS — add your macOS version
  • Browser: Chrome and Safari
  • Browser versions: add the versions used for the recording
  • Bundler: Vite
  • Bundler version: 8.3.1
  • React / React DOM: 19.3.0
  • Server adapter: Nitro 3.0.260903-beta

Additional context

Issues
#7815
#7956

Activity

  1. changed the title [-]Page briefly jumps to the top before restoring scroll on reload[/-] [+][Router] - Page briefly jumps to the top before restoring scroll on reload[/+] on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions