ngx-infinite-scroll icon indicating copy to clipboard operation
ngx-infinite-scroll copied to clipboard

Is there any way to restore scroll position while navigating back using browser button?

Open jigneshInd opened this issue 5 years ago • 4 comments

Is there any way to restore scroll position while navigating back using browser button?

jigneshInd avatar Dec 31 '19 12:12 jigneshInd

Same here. I'm trying to implement this feature, in initial searchs I didn find anything to manipulate the ngx-infinite-scroll position.

vitorpiovezam avatar Jan 27 '20 17:01 vitorpiovezam

Hello, same question here, any news or idea how this could be done ?

gwenaellarmet avatar Jun 02 '20 09:06 gwenaellarmet

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()

orizens avatar Jun 02 '20 15:06 orizens

Any update on this feature perhaps? Thanks @orizens

pausros avatar Nov 29 '23 11:11 pausros