Skip to content

how to set router.replace not reset scrollbar postion? #1813

Closed Answered by posva
yunxifd asked this question in Help and Questions
Discussion options

You must be logged in to vote

If you are seeing this behavior, it means you have a scrollBehavior() that scrolls up by default. You should probably tweak the behavior to not return the scroll up object in th scenario you want it to stay where it is. You could also add a custom query param or hash like #noscroll to completely avoid scroll behavior: if (to.hash === '#noscroll') return (within scrollBehavior)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by yunxifd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants