Smooth scroll when query params change but anchor doesnt #63184
The-Code-Monkey
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
There was this fix a while back that fixed something similar for the link tag
#52915
but what i have is a sticky nav that when you click changes the query params on the page and adds an anchor to the url so that you dont have to scroll past banners an stuff again. this uses router.push on the app dir.
Proposal
I propose the PR which addressed if the page stayed the same but the anchor changes then you guys don't force the scroll type and allow the browser to scroll itself.
to do the same thing for query params due to the same logic applying query params are there for search purposes so i want it to nicely scroll back up. This to me seems a bit like an oversite when the previous fix was done.
example urls..
router.push("?sort=asc#results")
router.push("?sort=desc#results")
with the current implmentation the page jumps which is quite jarring, it would be nice if it smooth scrolled.
Beta Was this translation helpful? Give feedback.
All reactions