You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dani-mp The best thing would be to open a new discussion to bring the subject back to life.
I'd like to take the time to bring back the subject back to life as I was myself facing the same situation today.
The suggestion that was originally made by @wladiston is the following:
diff--gita/node_modules/@remix-run/react/esm/scroll-restoration.jsb/node_modules/@remix-run/react/esm/scroll-restoration.jsindex3f5cc5f..1843e8f100644---a/node_modules/@remix-run/react/esm/scroll-restoration.js+++b/node_modules/@remix-run/react/esm/scroll-restoration.js
@@ -126,6+126,15 @@ functionuseScrollRestoration(){}// otherwise go to the top on new locations+if(+location.state&&+typeoflocation.state==="object"&&+location.state.scroll===false+){+return;+}// PATCH: allow to disable scroll restoration by passing { scroll: false } in Link state++window.scrollTo(0,0);},[location]);}
That way, one can decide to dismiss any scroll manipulation when following a Link with a scroll state set to false:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Upon @machour suggestion in #186 (comment)
I'd like to take the time to bring back the subject back to life as I was myself facing the same situation today.
The suggestion that was originally made by @wladiston is the following:
That way, one can decide to dismiss any scroll manipulation when following a
Link
with ascroll
state set tofalse
:Beta Was this translation helpful? Give feedback.
All reactions