delayed-scroll-restoration-polyfill icon indicating copy to clipboard operation
delayed-scroll-restoration-polyfill copied to clipboard

URL Redirect Instead of Browser Back Button Press

Open maks-humeniuk opened this issue 6 years ago • 3 comments

Hi there.

First of all, thanks for the polyfill. Though, I have a question regarding its work.

Say, we have two pages: A (with vertical scrollbar) and B. We scroll down on A and then redirect to B (by using button click, which calls Angular Router.navigate() method). Then we press browser Back button - scroll position restores as expected. But if we back from B to A not by using browser Back button, but with URL redirect (by using click in breadcrumbs), then scroll doesn't restore.

The question is: is it by design or is it an issue? In any case, is there any way to achieve needed behavior with your polyfill?

Thanks in advance.

maks-humeniuk avatar Apr 03 '18 15:04 maks-humeniuk

I'll let @janpaul123 chime in here, but I feel like that's a different case, best handled in your application.

trotzig avatar Apr 04 '18 07:04 trotzig

What does Google Chrome do in your scenario? This is intended as a polyfill for Chrome's behaviour.

janpaul123 avatar Apr 05 '18 05:04 janpaul123

Without the polyfill it scrolls to the top in both cases.

maks-humeniuk avatar Apr 05 '18 06:04 maks-humeniuk