MOBILE-4470 infinite-loading: Fix consecutive loads not working
parent
ed22463b9c
commit
efb8fdd630
|
@ -9,7 +9,8 @@
|
|||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ion-infinite-scroll [disabled]="!enabled || error || loadingMore" (ionInfinite)="loadMore()" [position]="position">
|
||||
<!-- Don't allow disabling infinite-scroll while loading more items, otherwise infinite scroll stops working. -->
|
||||
<ion-infinite-scroll [disabled]="!loadingMore && (!enabled || error)" (ionInfinite)="loadMore()" [position]="position">
|
||||
<ion-infinite-scroll-content />
|
||||
</ion-infinite-scroll>
|
||||
|
||||
|
|
|
@ -109,13 +109,11 @@ export class CoreInfiniteLoadingComponent implements OnChanges {
|
|||
/**
|
||||
* Complete loading.
|
||||
*/
|
||||
complete(): void {
|
||||
if (this.position == 'top') {
|
||||
// Wait a bit before allowing loading more, otherwise it could be re-triggered automatically when it shouldn't.
|
||||
setTimeout(() => this.completeLoadMore(), 400);
|
||||
} else {
|
||||
this.completeLoadMore();
|
||||
}
|
||||
async complete(): Promise<void> {
|
||||
// Wait a bit before allowing loading more, otherwise it could be re-triggered automatically when it shouldn't.
|
||||
await CoreUtils.wait(400);
|
||||
|
||||
await this.completeLoadMore();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue