Replies: 4 comments
-
I would love this! |
Beta Was this translation helpful? Give feedback.
-
well in my code, I update the query params and it doesn't scroll to top can you share a bit of your code to see what could be wrong ? |
Beta Was this translation helpful? Give feedback.
-
After upgrading to remix 1.2.2 it stop happening, although, I'd like to update the query string without making a request to the server - if I put a For now I'm using |
Beta Was this translation helpful? Give feedback.
-
Continue discussion in #1920 |
Beta Was this translation helpful? Give feedback.
-
When using
<ScrollRestoration />
every query param change makes the page scroll to the top, but I guess we only want that when changing the pathname.I could get this tweak working locally by changing this line to
}, [location.pathname]);
, which then makes the callback to be executed only when thepathname
changes.A common use case is a modal that opens through a query param for example, it doesn't make sense to scroll the entire page to the top when opening it. Or table results that are filtered based on the query params, it doesn't make sense to change the scroll position when changing the filters.
Does that change make sense? I'm happy to open a PR if so.
Beta Was this translation helpful? Give feedback.
All reactions