You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the { shallow: true } option with router.push previously prevented the browser from scrolling to the top of the page. I've tested versions 10.0.0, 10.0.1, 10.0.5 & the latest 10.0.6-canary.5 all of which have the bug. When using 9.5.5 and 9.5.6-canary.18 no scrolling happens which is the expected result.
Expected Behavior
No scrolling to top.
To Reproduce
Update a query string using router.push with the shallow option set to true. I'm using the example below for a "See More Results" button.
Using router.push('some-url?page=2', undefined, { shallow: true })
EDIT: Formatting
The text was updated successfully, but these errors were encountered:
It's missing the current docs, but you can prevent this by passing { scroll: false } as the third parameter, e.g. router.push(url, as, { scroll: false }).
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
12.18.3
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
Using the
{ shallow: true }
option with router.push previously prevented the browser from scrolling to the top of the page. I've tested versions 10.0.0, 10.0.1, 10.0.5 & the latest 10.0.6-canary.5 all of which have the bug. When using 9.5.5 and 9.5.6-canary.18 no scrolling happens which is the expected result.Expected Behavior
No scrolling to top.
To Reproduce
Update a query string using router.push with the shallow option set to true. I'm using the example below for a "See More Results" button.
Using
router.push('some-url?page=2', undefined, { shallow: true })
EDIT: Formatting
The text was updated successfully, but these errors were encountered: