-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Instant scrolling when changing pages #880
Comments
A complementary suggestion: If the navigation link includes a hash link, then scroll to the element with that id instead of the top |
I thought the default behavior of scrollTo(0,0) was instant? Are you seeing this on a specific browser? |
I use chrome. The default behavior is 'auto' which should be instantaneous according to the documentation, but in practice it is not. mdn/content#2719 |
When I test this locally, I am not seeing smooth scrolling - it's instant. Maybe you have a script or extension that is intercepting this and applying smooth scrolling? |
I tested it with an empty project and on Edge, and it still happened. Did you add |
Ah - sorry, I had missed that you were asking for this as a way to override global |
Is your feature request related to a problem? Please describe.
If you enable smooth scrolling via css styles, forward navigation makes a animated smooth scroll to the top of the page when loading the page.
Describe the solution you'd like
I think this scroll should always be instantaneous.
One way to get this is by passing the 'behavior' parameter to the scroll function.
Change this:
wmr/packages/preact-iso/router.js
Line 122 in 9b425c5
To:
Additional context
Relates to #496
The text was updated successfully, but these errors were encountered: