#avoid page scroll when router.replace

4 messages · Page 1 of 1 (latest)

half stream
#

How can I avoid the page to scroll up to the top when I use router.replace? I only add query params and dont need the page to scroll up. Its even really bad for user experience in this cas!

frosty harnessBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

royal garden
#

Nextjs Doc: ```router.replace(href: string, { scroll: boolean }): Perform a client-side navigation to the provided route without adding a new entry into the browser’s history stack.

#

There is a scroll param