Ersin Ergül
Ersin Ergül

Reputation: 11

Ionic 4: ion-content scroll not working after swipe gesture added

After adding swipeEvent on ion-content infiniti-scroll stopped working. Is there any way to fix this?

Thanks

Html code:

    <ion-content (swipe)="swipeEvent($event)">
  <infiniti-scroll
        [data]="data"
        [pagination]="page"
        [folderType]="folderType"
        [loadFunc]="loadMoreDataWithInfinitiScroll"
      ></infiniti-scroll>
    </ion-content>

TS code:

 swipeEvent($event: any) {
    if ($event.offsetDirection === 4) {
      this.breadcrumbService.goTo(this.folderType, this.currentFolder);
    }
  }

Upvotes: 0

Views: 1041

Answers (1)

Chetan More
Chetan More

Reputation: 96

Yes, I do not think (swipe)="swipeEvent($event) works in the ion-content. You will have to use another directive. But an alternative is to create a div inside the ion-content and insert your content inside the div. Content...

refer the below link for the detail answer

https://forum.ionicframework.com/t/ion-content-swipeevent/76147

Upvotes: 2

Related Questions