vercel / vercel/next.js

Content visibility breaks navigation back

Open
#87,504 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Linking and Navigating
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the reproduction at https://github.com/avaltat/next-content-visibility and follow the /foo-to-bar navigation steps, including scrolling to the middle of the page. Compare the scroll position after navigating back with the original position; done means back navigation restores the prior scroll position in the deployed environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.