tinro icon indicating copy to clipboard operation
tinro copied to clipboard

Maintain previous scroll position when navigating back

Open jamauro opened this issue 3 years ago • 1 comments

When I navigate to a new route and then back, it would be nice if the page was at my previous scroll position so that I don't have to scroll down from the top.

I saw your note Back and forward cause remounting of corresponding components so scroll position always be on the top. from https://github.com/AlexxNB/tinro/issues/3#issuecomment-620520511. I tried the scroll restoration polyfill and it isn't working for me. Would love to see tinro support this instead of hacking together something on my end that I'm sure wouldn't be as good of a solution. :)

jamauro avatar Sep 16 '21 00:09 jamauro

Browser leave the scroll position if your elements render rapidly. But other case you should restore scroll yourself. I don't want implement this feature in tinro, because it is not universal.

AlexxNB avatar Nov 12 '21 08:11 AlexxNB