Replies: 2 comments 1 reply
-
there was a bug that is now fixed |
Beta Was this translation helpful? Give feedback.
1 reply
-
This has been answered by the fact that there was a fix which resulted in now treating search param changes as url changes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
what is the expected behavior when clicking on a
Link
that targets the same route but with a changed search param?Example:
Link
components for navigating to another page, e.g. when on page 1, there could be a link to the next page 2 which should navigate to/my-list?page=2
/my-list?page=1
and/my-list?page=2
treated as a different page?Link
Currently though a search param change like described above retains the current scroll position. That means for example that a click on a pagination button at the bottom of a long list changes the search parameter in the url and gets picked up by e.g. loaders but the page stays scrolled down to the pagination button.
Is my basic assumption wrong, that
/my-list?page=1
and/my-list?page=2
are treated as separate pages and thus reset the scroll position?Is there a way to get to my expected behavior of having the scroll position reset when clicking on such a link? For some reason
resetScroll={true}
does not seem to work at all in our case.Maybe helpful for this discussion: I created a minimal example at https://stackblitz.com/edit/github-3fv17a?file=src%2Fmain.tsx where you can see a similar example to what I described. A click on a link does change the search params and re-render (parts of) the page but the scroll position does not reset to top.
Beta Was this translation helpful? Give feedback.
All reactions