Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable scroll to top when filtering #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anthonyiu
Copy link

It's a bit annoying whenever the filter applies it scrolls to the top instead of seeing the results instantly.
Add { scroll: false } to router.push() to improve UX

add { scroll: false } to router.push() to improve UX
@issamahwach
Copy link

"next": "14.0.0" with router.push(newPathName, {scroll: false} ); worked for me!

@TienPham18
Copy link

"next": "14.0.0" with router.push(newPathName, {scroll: false} ); worked for me as well!

@aman-q
Copy link

aman-q commented Mar 24, 2024

With the Next js 14 this issue is resolved we just have to make changes in the router.push function
router.push(newPathname, { scroll: false })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants