I have a component consisting of a list of many cards (like a grid format). Upon scrolling down and selecting one of the cards, I would expect to return to the same scroll position when I press the browser back button.
I'm unable to use Router's scrollPositionRestoration method as it is located in my child component.
Appreciate your help!
Okay I found a solution after reading Angular 2 Scroll to top on Route Change. I just added a window.setTimeout as a temporary fix, even though I don't think it's the best solution.
UPDATE (4th Oct 2019)
My page lazy loads its contents. I've update my code to the following:
Let me know if there are any better solution out there. If the user can immediately return to the same position of the previous page instead of scrolling downwards that would be best, thanks!
I was able to make it work by adding
And it worked 100%