[SOLVED] Ion-slides: how to detect released slide?


#1

Hi,

With the attribute ionSlideDrag of ion-slides I could detect when a slide is slided/dragged/moved.

With the attribute ionSlideDidChange of ion-slides I could detect when the user successfully slided/moved to the next or prev slide.

But how could I detect the case where a user begin to slide but finally doesn’t complete his action and stay on the same slide? Do you know what I mean…

<ion-slides (ionSlideDrag)="sliding()" (ionSlideDidChange)="slideChanged()" (...)="userStayedOnTheSameSlide()>
      <ion-slide *ngFor="....">
      </ion-slide>
 </ion-slides>

Reference: http://ionicframework.com/docs/api/components/slides/Slides/


#2

I ended up subscribing to the ionSlideTouchEnd event (which is right now not exposed, therefore I opened a feature request).

Solution:

 @ViewChild(Slides) slides: Slides;

 this.slides.ionSlideTouchEnd.subscribe(() => {
      // Do stuff
 });

Feature request: