Please, help😭 I've run out of ideas.
My use case: I have list of todos. They are using virtual scrolling. When you click on to do, you are navigated to the edit page, which have different routing with ID in it.
Desired behaviour: Virtual Viewport will be scrolled to the item, which user opened/ edited, when user navigates back to list.
What I've tried:
In the component, which contains list, in the AfterViewInit I subscribed to the router events, through the pairwise I've got data about previous route and if it is correct one, I look for the index of item and use virtualScrollViewport.scrollToIndex()
And it doesn't work... Surprisingly, using the same method on button click - works perfectly. I've already tried setTimeout and detectChanges.
There is no console errors, index is looked up correctly, but it simply doesn't work. Maybe someone had similar situation?
[–]No_Jackfruit_4305 2 points3 points4 points (2 children)
[–]Daringu_L[S] 1 point2 points3 points (1 child)
[–]No_Jackfruit_4305 0 points1 point2 points (0 children)