ngx-infinite-scroll
ngx-infinite-scroll copied to clipboard
Is there any way to restore scroll position while navigating back using browser button?
Is there any way to restore scroll position while navigating back using browser button?
Same here.
I'm trying to implement this feature, in initial searchs I didn find anything to manipulate the ngx-infinite-scroll position.
Hello, same question here, any news or idea how this could be done ?
hi. if you're asking about restoring the last triggered scrolled position - that's not straight forward and requires some work. internally, nis tracks the last scroll position - https://github.com/orizens/ngx-infinite-scroll/blob/master/src/services/scroll-register.ts#L23 by using the scrollstate class https://github.com/orizens/ngx-infinite-scroll/blob/7fc4390ebefb7e3040778d362b4ae8446ca6a10a/src/services/scroll-state.ts#L3
the above might be easy to expose.
a challenge would be how the last scroll position would actually be applied: the value for last scroll is px - the rendered list must include the same as it was when scrolled - this would have to managed externally.
OTHERWISE, you may track scroll by attaching a listener and save the scroll position - while you can use DOM's 'scrollTo' or element.scrollIntoView()
Any update on this feature perhaps? Thanks @orizens