-
Trying to have the browser scroll to the top upon moving to next page using You can check it in codesandbox example
Example - https://codesandbox.io/s/fast-violet-tfdcm8
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
It's these lines in the remix/packages/remix-react/scroll-restoration.tsx Lines 119 to 123 in f8857a2 I imagine it's there so when you're doing submit using For now, I simply copied the code into my project and removed those lines. NOTE: I would not use |
Beta Was this translation helpful? Give feedback.
-
I think I added a failing test for this a while ago here. I am also doing the same as @kiliman, rolling my own |
Beta Was this translation helpful? Give feedback.
It's these lines in the
<ScrollRestoration/>
component that makes it not work.remix/packages/remix-react/scroll-restoration.tsx
Lines 119 to 123 in f8857a2
I imagine it's there so when you're doing submit using
useFetcher
you typically don't want the page to scroll. However, this does break full page submits.For now, I simply copied the code into my project and removed those lines.
NOTE: I would not use
reloadDocument
unless absolutely necessary, as this causes a full page load (downloads HTML, CSS, JavaScript, etc.) instead of ju…