We have a specific use case where we want the unable/disable the infinite scrolling based on certain criteria(“showInfiniteScrollDiv”).
<ion-content scroll="true"> <div ng-if="showInfiniteScrollDiv"> <ion-infinite-scroll on-infinite="loadMoreData()" distance="2%" ng-if="dataAvailable"> </ion-infinite-scroll> </div>
here ,we append 10 rows to the model on every call of infinite scroll and ng-if(“dataAvailable”) of infinite scroll returns false when “rows.length % 10” returns a non-zero number. The things works fine till this point and on-infinite scroll function is called only when we scroll to end of the view.
Now we have a searchbox to filter out the data and we clear the rows in the model when user starts typing.On the keyup of text box “loadMoreData” is called. However for the first keyup when the data is received, it suddenly scroll to the end of view and calls on-infinite scroll function again which is undesired.
Is there something that i’m doing incorrectly?