Merge pull request #1754 from dpalou/MOBILE-2841

MOBILE-2841 infinite: Don't send event if position is top
main
Juan Leyva 2019-02-07 15:09:43 +01:00 committed by GitHub
commit 8280694383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -45,13 +45,13 @@ export class CoreInfiniteLoadingComponent implements OnChanges {
* @param {SimpleChange}} changes Changes.
*/
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.
// Send a fake scroll event to make infinite scroll check if it should load more items.
setTimeout(() => {
const event: any = new Event('scroll');
this.content.ionScroll.emit(event);
});
}, 400);
}
}