vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.08k stars 26.72k forks source link

Docs: Scroll Restoration broken #70148

Open jantimon opened 4 days ago

jantimon commented 4 days ago

What is the documentation issue?

When navigating through the Next.js documentation, there's an issue with the back button functionality that might be a bug in the APP router

Steps to Reproduce

  1. Go to https://nextjs.org/docs/app/building-your-application/caching#request-memoization
  2. Click on "Fetch API" in the content
  3. Click on "Fetch API Reference"
  4. Use the browser's back button

https://github.com/user-attachments/assets/0ef14151-a9d6-47d1-9f3a-31306152cec0

Is there any context that might help us understand?

This video was recorded in Brave

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/app/building-your-application/caching#request-memoization

samcx commented 3 days ago

@jantimon Thanks for sharing! We are taking a look.

I see that if you click the back button twice, the scroll restoration goes to the correct page.