MOBILE-2841 infinite: Don't send event if position is top
parent
b7d56bf641
commit
eda5e3e08a
|
@ -45,13 +45,13 @@ export class CoreInfiniteLoadingComponent implements OnChanges {
|
||||||
* @param {SimpleChange}} changes Changes.
|
* @param {SimpleChange}} changes Changes.
|
||||||
*/
|
*/
|
||||||
ngOnChanges(changes: {[name: string]: SimpleChange}): void {
|
ngOnChanges(changes: {[name: string]: SimpleChange}): void {
|
||||||
if (changes.enabled && this.enabled) {
|
if (changes.enabled && this.enabled && this.position == 'bottom') {
|
||||||
// Infinite scroll enabled. If the list doesn't fill the full height, infinite scroll isn't triggered automatically.
|
// Infinite scroll enabled. If the list doesn't fill the full height, infinite scroll isn't triggered automatically.
|
||||||
// Send a fake scroll event to make infinite scroll check if it should load more items.
|
// Send a fake scroll event to make infinite scroll check if it should load more items.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const event: any = new Event('scroll');
|
const event: any = new Event('scroll');
|
||||||
this.content.ionScroll.emit(event);
|
this.content.ionScroll.emit(event);
|
||||||
});
|
}, 400);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue