I tried to use infinite scroll in an application but I have some issues:
loadMore method is called too often. e.g. I have 10 items to display (3 items are displayed on the screen, for the next 7 I have to scroll) and the loadMore event is called for 7 times.
should I throw the event: scroll.infiniteScrollComplete as in ionic 1? (e.g. $scope.$broadcast(‘scroll.infiniteScrollComplete’). If yes, how should be throw the event (exists a sample somewhere)?
Perhaps I missed an update but I’m pretty sure infinite scroll hasn’t been added to Ionic 2 yet (I don’t see it in the docs), where are you getting this from?
So, I added in page the code <ion-infinite-scroll [onInfinite]="loadMoreData()"></ion-infinite-scroll> inside an ion-list and the loadMoreData method is call on page scroll. But the method is called too often.
I think there is some confusion here. The virtual.ts file was added a long time ago and it is supposed to replace collection-repeat, but it hasn’t been updated and it is not working at the moment. There is no ion-infinite-scroll component or directive at the moment. I see the issue discussion but it doesn’t exist. I’m honestly not sure how that function is being called…as we don’t have any onInfinite attribute either.
As for the roadmap, we created a doc and are updating it with missing/incomplete components. There are no set dates - we are just adding to it right now: Roadmap
We do not have any scheduled dates for adding components at this time.
We are focused on improving performance & getting the documentation up to date with existing components before adding any new components. I can say that we will not be adding any new components between now and next Wednesday (2/10). I would expect them to be added sometime soon after that.
@brandyshea
does ion-infinite-scroll working now on ionic2?
i have implemented the following code, and the ionInfinite event is never being fired.
i have spent whole day dealing with it and i’m really stuck…
@brandyshea
in addition to the question above, do i need to add ion-scroll in order that the list will be scroll-able, or does this behavior is built-in with the list?
if i omit the style=“overflow-y: auto”, no scrollbar is displayed, and the list is not scroll-able, even if add ion-scroll.
please advise.
hi @brandyshea/@mhartington/anyone else from the ionic team,
is there any solution to my scrolling issue?
as i described before, i’m using ionic2, i have an ion-list inside ion-content, and i have two problems:
the list is not being scrolled at all, unless i add style=“overflow-y: auto” to the content. it is not scrolled even if i add ion-scroll inside/outside the content.
when i add the overflow-y and scrollbar is displayed, the infinite-scroll does not work. the ionInfinite event is not fired.
what i need is a list that is scrollable without scrollbars, and infinite-scroll functionality.
i need a solution as soon as possible and really appreciate your reply.
thanks.
thanks @mhartington, it seems to work now.
there is only issue with the infinite-scroll-content, which is sometimes not being displayed, and sometimes being displayed after loading the more data.
what is the purpose of the setTimeout? maybe it is related to this?
and one other question: after loading more data, is there option to scroll to the top of the list?