Skip to content

Content visibility breaks navigation back #87504

@avaltat

Description

@avaltat

Link to the code that reproduces this issue

https://github.com/avaltat/next-content-visibility

To Reproduce

  1. Clone the repo
  2. Navigate to /foo
  3. Scroll to the middle of the page
  4. Navigate to bar and then navigate back

Current vs. Expected behavior

The back navigation is not at the same scroll position

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041
  Available memory (MB): 24576
  Available CPU cores: 12
Binaries:
  Node: 22.21.1
  npm: 11.6.4
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 16.1.0 // Latest available version is detected (16.1.0).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Linking and Navigating

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions