Skip to content

Bug: page scroll position is not preserved when navigating back #2871

@00-slats

Description

@00-slats

Describe the bug

When navigating between pages on base/web, using the browser’s back button does not always restore the previous scroll position. This can disrupt the user experience, especially on long pages.

Steps

  1. Open a long page on the Base website.
  2. Scroll down significantly.
  3. Click a link to navigate to another page.
  4. Use the browser back button.
  5. Observe that the page loads at the top instead of the prior scroll position.

Expected behavior

When navigating back to a previously visited page, the scroll position should be restored to where the user left off. This behavior should be consistent across supported browsers and routes.

Proposed Solution

Ensure that client-side navigation preserves and restores scroll position when navigating back. This may involve explicitly managing scroll restoration in the routing layer so that returning users land at their previous position instead of the top of the page.

Environment

  • Device: Desktop
  • OS: macOS 14.x
  • Browser: Chrome
  • Browser Version: 120+
  • Reproducibility: Always

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