Ionic2 virtualscroll and infinitescroll

I wonder if it would be possible to use VirtualScroll and ion-infinite-scroll together. The benefit is to handle result that grows significantly after loading many subsequent chunks. On the other side its mentioned on VirtualScroll performance tips:

  • Changing the dataset requires the entire virtual scroll to be reset, which is an expensive operation and should be avoided if possible.

I wonder if growing the dataset also requires reseting.

4 Likes

I also want to know i these two component can work together.

I didnā€™t tried, but i think it should be work together.

Important point. We need to know (according to the documentation*) if the performance will decrease using virtual scroll with infinite scroll @mhartington

*The data that builds the templates within the virtual scroll. This is the same data that youā€™d pass to ngFor. Itā€™s important to note that when this data has changed, then the entire virtual scroll is reset, which is an expensive operation and should be avoided if possible.

Hi, Iā€™m also wondering the same thing @mhartington

VirtualScroll and infiniteScroll together?

At the moment, they may ā€œworkā€, but they definitely can be improved.
This first pass at virtual scroll just add the initial functionality.
But we can expect that virtualScroll will work with things like Pull to refresh and InfiniteScroll.

I have everything working together InfiniteScroll+VirtualScroll+Refresher and everything seems to work fine.

The only annoyance is that every time I add new items to the dataset the VirtualScroll reset its position.

Would it be possible to change that behavior?

1 Like

Iā€™m seeing the same behaviour on adding new items on my list. Scroll position changes back to top. Have you found something that prevents this?

so far, Virtual scroll is better fitted for large static lists.

Virtual scroll should add support for dynamically loading some more, at some pointā€¦ :smile:
Those points, and this ā€˜someā€™, should be configurableā€¦ I think being able to pass a callback function, at the configured point (like, 75% through total, for example) would be greatā€¦ it should be possible.
Would be cool if it was smart enough to handle the ā€˜pagingā€™ itself as well. (instead of manually doing offset tricks)