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
Hello! This library works fine for default (body) scrollable container. Hovewer, it's often necessary to have a combination of scrollable container and a sticky header. Or something else for that matter. Unless I messed up, the following does not work with next-scroll-restorer:
exportfunctionShell(){// using Tailwind classes, hopefully it's clearreturn<divclassName="overflow-auto max-h-screen">
...
</div>}
Here's the same problem discussed in Remix framework community and some yet unofficial solutions to it.
Context
I'm trying to auto-restore scroll position on a user search page with an infinite scroll (powered by React-Query).
I'm clicking on a Profile Detail link, then I'm clicking on the native Back button in Chrome. My own ad-hoc restorer works fine so there's no structural issue that would block the desired behavior.
The text was updated successfully, but these errors were encountered:
Hello! I have some ideas on how to implement it but will do so later.
If you'd like to speed up the process, feel free to open a pull request. However, please ensure that you include tests for this particular case.
https://github.com/javascripter/next-scroll-restoration
I ended up not using custom scrolling elements for our website so I'm not using it yet in production but here's my attempt at it when I was trying to solve it (feel free to take implementation ideas from my library if applicable).
Using scroll events to discover custom scrolling elements automatically seems to be reliable in dynamic websites.
Current known problem in my implementation is when navigating to the same href in different history stacks it wrongly restores scrolls, since my implementation uses location.pathname as the history state key.
next-scroll-restorer seems to cover lots of edge cases quite well so if non-body container scroll restoration gets implemented in this library it'd be pretty awesome!
Hello! This library works fine for default (
body
) scrollable container. Hovewer, it's often necessary to have a combination of scrollable container and a sticky header. Or something else for that matter. Unless I messed up, the following does not work with next-scroll-restorer:Here's the same problem discussed in Remix framework community and some yet unofficial solutions to it.
Context
I'm trying to auto-restore scroll position on a user search page with an infinite scroll (powered by React-Query).
I'm clicking on a
Profile Detail
link, then I'm clicking on the nativeBack
button in Chrome. My own ad-hoc restorer works fine so there's no structural issue that would block the desired behavior.The text was updated successfully, but these errors were encountered: