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