Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70919

Ionic refresher does not get disabled

$
0
0

i’m using ion-refresher, to refresh the data which works completely fine, now what i want to do is to disable the refresher for some time to cool it down after refresh but it does not get disabled and i’m still able to pull refresh ,although i can see the updated value of disabled in DOM.

ionic version : 7
angular version: 17
below is my code

 <ion-refresher
      slot="fixed"
      (ionRefresh)="doRefresh($event)"
      [disbaled]="isRefresherDisabled"
    >
      <ion-refresher-content
        pullingIcon="refresh-outline"
        pullingText="Pull to refresh"
        refreshingSpinner="bubbles"
      >
      </ion-refresher-content>
    </ion-refresher>

  async doRefresh(event: any) {
    await this.setEnableDates(true);
    await this.scheduleCache.initDatasource();
    if (event) await event.target.complete();
    this.disableRefresherForCooldown();
  }

  disableRefresherForCooldown() {
    this.isRefresherDisabled = true; // Disable the refresher
    // Re-enable the refresher after 20 seconds
    setTimeout(() => {
      this.isRefresherDisabled = false;
    }, 20000); // Cooldown duration: 20 seconds
  }

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 70919

Trending Articles