"ion-infinite-scroll>on-infinite" is called on first view rendering


#1

I’m using “ion-infinite-scroll” with my “ion-list”. Everything seems fine, except that “on-infinite” action is fired each time the page is loaded for the first time and I don’t want this to happen. I’m using caching in my list so on first rendering I load data from local storage, but still “on-infinite” is called, so app queries remote resource for data and that’s kinda bad…

I’ve seen the similar topic ( The infinitescroll will running on-infinite callback automatic when page loaded ), but haven’t find the final solution there. It there any progress with this issue?


#2

+1 to this.

This is still a recurring issue in the latest master branch. I’ll check if there is any Issues or Pull Requests over at the repo regarding this.

Edit
Ok, I can see there are several posted issues at github, such as #1579 or #2583. Ironically, those two are closed.

Any news on the fix for this?


#3

This is an old post but for anyone else having the same problem, perhaps infinite-scroll fires because when first entering the view it has no data (data) and the end of ion-content (scrollwise) is reached. One hack I do in these cases is to add a bool var to ng-if on infinite-scroll directive and after the remote response has finished I activate it using a timeout