Replies: 7 comments 17 replies
-
To devs: Not only scroll to top need to be disabled, but also scroll to left needs a way too, I'm having a overflow-x list, everytime user clicks link inside of it, the scroll x position reset to 0, tried both |
Beta Was this translation helpful? Give feedback.
-
When utilizing the Intercepting Routes feature to create modals, the page scrolls to the top, which is bad to usability. For example, consider a masonry grid with photos, similar to Instagram's explore page or Pinterest. When a user clicks on a photo, a modal opens with shareable content via a URL, while the page's scroll position remains unchanged. However, when using Next.js 13, as demonstrated in the nextgram by the Vercel Team, which employs the new "Parallel Routes and Intercepting Routes" features, if a user scrolls to the last photo and clicks on it, the scroll position resets, negatively impacting the user experience. |
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue with the app router. I want to add a load more button to add more items on the page and also update the query parameters to reflect the page. It does not matter whether I use the https://next13-cypress-music-search.vercel.app |
Beta Was this translation helpful? Give feedback.
-
Related issue: #50105 |
Beta Was this translation helpful? Give feedback.
-
Also seeing this issue... |
Beta Was this translation helpful? Give feedback.
-
Not working scroll false |
Beta Was this translation helpful? Give feedback.
-
Also getting this issue on App Router using 14.0.1. I've tried using a Link tag with scroll={false} or a router.replace with scroll={false} and my pages scroll to the top anyway in both cases. |
Beta Was this translation helpful? Give feedback.
-
Summary
It seems like the previous api to prevent scroll has been removed for next.js 13 i.e. before we could do something lilke
router.push("path",undefined, {scroll: false}
but now the only option is 'forceOptimisticUpdate'. Note: the Link component still has the option to disable scroll but its not the right property for my use case. Does anyone know how i can disable scroll to top using the router as it was beforeAdditional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions