Scroll Behavior on page change #299
Replies: 5 comments 6 replies
-
Agree with this |
Beta Was this translation helpful? Give feedback.
-
Any news about this? I think "Scroll to top" should be the default behavior when switching routes as this is the default behavior of how non-SPA web pages work. |
Beta Was this translation helpful? Give feedback.
-
I believe this should be a must have feature for this library to actually be used in production by many websites even though right now it's still in beta. |
Beta Was this translation helpful? Give feedback.
-
https://tanstack.com/router/v1/docs/guide/scroll-restoration |
Beta Was this translation helpful? Give feedback.
-
For anyone coming from Google scratching their heads all weekend wondering why their scroll restoratiom works, but only sometimes: You might have set a custom html,
body {
- height: 100%; /* or 100vh or something like that */
width: 100%;
...
} Remove the Hope this help someone. Maybe this will be worthy to add to the docs? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I wonder if it would be ok/useful to have an option in router to allow scroll behaviors.
for exemple =>
I couldn't find anything in the docs, and this is something that would be nice to handle in the library instead of adding code on each page or some wrapper to always move to top on location change.
Beta Was this translation helpful? Give feedback.
All reactions