Ion-item-sliding to automatically trigger a button

I was wondering if there is a way to automatically trigger the buttons when using the ion-item-sliding component?

For example, I have the following code:

    <ion-item-sliding *ngFor="let cnt of contacts">

      <ion-item (click)="openInvite(cnt)">

      <ion-item-options side="left">
        <button favorite (click)="acceptInvite(cnt)">Accept</button>

      <ion-item-options side="right">
        <button danger (click)="dismissInvite(cnt)">Dismiss</button>


Could I trigger the acceptInvite(cnt) or dismissInvite(cnt) automatically when a user swipes the row to appropriate side?

I’m aware of the ionDrag event, and the getSlidingPercent() method, and that I could trigger a function if, for example, item.getSlidingPercent() > 1. However, that doesn’t handle the case if the user changed his mind and decided to slide the item back to position, if you know what I mean…

In essence, I could use the getSlidingPercent() method only if I could also deduct somehow if the user stopped the drag when the getSlidingPercent() > 1. So is there a way to do this?


Have you find out solution? What version of Ionic 2 do you use?

I belive there is a bug, since getSlidingPercent() returns infinity, not a real number. If it would return number, this could be easily done by executing function just after percent reaches >50 or so. (or I don’t know exact units used)