How to enable infinite scroll (ion-infinite-scroll) after setting to false

I am using infinite scroll for load more data. When the data is already reach the limit, I’m setting enabled to false. But, when I combine it with search data, the infinite scroll can’t enabled to true since I’m setting to false before. How to enable again the infinite scroll when the setting is already false?

2 Likes

I’m having the same issue as well. When I use pull to refresh after the infinite scroll is complete, I expect to be able to re-enable infinite scroll since my results have been reset. Any way around this?

Hi

I did it now :slight_smile: Here is my solution;

export class HomePage {
reActiveInfinite: any;



doInfinite(infiniteScroll) {
this.reActiveInfinite = infiniteScroll;


infiniteScroll.enable(false);
}



doRefresh(refresher) {
this.reActiveInfinite.enable(true);


13 Likes

Nice! This seems like a great solution, thanks for sharing.

1 Like

thanks man…works like a charm.

This one worked for me, as shown in the component example code:

export class Someclass {

  @ViewChild(IonInfiniteScroll, { static: false}) infinityScroll: IonInfiniteScroll;
...
    this.infinityScroll.disabled = false;
...
2 Likes

Thanks Man:) This is a good solution.