question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite scroll stopped working.

See original GitHub issue

Description: Ionic Infinite scroll is no longer working.

Steps to Reproduce: Simply start a new tabs project - ionic start myApp tabs

In tab2.page.html add:

<ion-header>
  <ion-toolbar>
    <ion-title>
      Tab Two
    </ion-title>
  </ion-toolbar>
</ion-header>
  <ion-content>
    <ion-button (click)="toggleInfiniteScroll()" expand="block">
      Toggle Infinite Scroll
    </ion-button>
  
    <ion-list>
      <ion-item *ngFor="let i of items">{{i}}</ion-item>
    </ion-list>
  
    <ion-infinite-scroll (ionInfinite)="loadData($event)">
      <ion-infinite-scroll-content
        loadingSpinner="bubbles"
        loadingText="Loading more data...">
      </ion-infinite-scroll-content>
    </ion-infinite-scroll>
  </ion-content>

In tab2.page.ts add

import { Component, ViewChild } from '@angular/core';
import { IonInfiniteScroll } from '@ionic/angular';
@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss']
})

export class Tab2Page {
  items = [];
  @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;

  constructor() {
    for (let i = 0; i < 30; i++) {
      this.items.push( this.items.length );
    }
  }

  loadData(event) {
    console.log('Begin async operation');

    setTimeout(() => {
      for (let i = 0; i < 30; i++) {
        this.items.push( this.items.length );
      }
      console.log('Done');
      event.target.complete();

      // App logic to determine if all data is loaded
      // and disable the infinite scroll
      if (this.items.length == 1000) {
        event.target.disabled = true;
      }
    }, 500);
  }

  toggleInfiniteScroll() {
    this.infiniteScroll.disabled = !this.infiniteScroll.disabled;
  }
}


Then save and run ionic serve.

Output:

The infinite scroll just does not work. The loadData method never gets fired. I have also tested on ios and the same problem occurs. I am on ionic 5.2.1, I have also tried with earlier versions and same result.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Jul 8, 2019

Hi there,

This is a known issue with 4.6.0. We are preparing a 4.6.1 release that addresses this issue and hope to have it out soon.

I am going to close this issue in favor of the main 4.6.0 bug tracker: https://github.com/ionic-team/ionic/issues/18655

Thanks!

0reactions
ionitron-bot[bot]commented, Aug 9, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngInfiniteScroll not working - Stack Overflow
Scroll event is only triggered on page load, after that nothing seems to trigger it. Can anyone please shed some light. I tried...
Read more >
Infinite scroll stopped working - WordPress.org
Hello,. Since yesterday the infinite scroll option has stopped working. The website went live over 1 month ago and it had been working...
Read more >
Infinite scroll not working - Get Help - Frontity Community Forum
Hello guys, I am trying to build a site using frontity with infinite scroll feature on the site, but I am stuck at...
Read more >
Infinite scroll not working correctly - Toolset
Hi For some reason when I enable infinite scroll when you get down to the bottom it swaps out the content that's already...
Read more >
Infinite scroll not working · Issue #1685 · vueuse ... - GitHub
You should ensure the scroll container height < scroll content height.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found