[SOLVED]InfiniteScroll iOS disappears when there is data


#1

InfiniteScroll on iOS disappears when there is data load.

Meanwhile there is no data infiniteScroll keeps calling the method to get the data, but when the data is load to the view, infiniteScroll stops loading more and the spinner disappears.

I’ve been looking for in this forum but nothing resolves it.

On Android and desktop it is working well.

Thanks.


#2

SOLVED

It was because if you are loading data get by async call and using promises, it needs to call a resolve() to end the callback.

Example:

doInfinite(): Promise {
console.log(‘Begin async operation’);

return new Promise((resolve) => {
  setTimeout(() => {
    for (var i = 0; i < 30; i++) {
      this.items.push( this.items.length );
    }

    console.log('Async operation has ended');
    resolve();
  }, 500);
})

}