Is there an touch end or touch up event in Ionic?


#1

So I can’t find any documentation or articles on this to save my life. I have a ion-range bar that I am using to control audio so you can scroll to certain parts in a song for example. Here it is:

<ion-range min="0" max="100" [(ngModel)]="audioPlayerService?.info.percentageComplete" (ionChange)="controlDrag($event)" color="secondary"></ion-range>

It is hooked into my audio player service and I have an ionChange event. I want to be able to show a specific DIV when this ionChange event is taking place. By default the DIV is hidden.

Either:

  • How do I detect that the ionChange event is about to end so that I can re-hide the div?
  • Or is there a good method to hide and show divs depending on gestures like (press).

Right now I just have a ngIf on the div I need to show and change the value of this to true when the ionChange event is taking place, but I can’t change it back to false because I can’t figure out when the event is going to end.

<div *ngIf="waveblurToggle"></div>

Thanks. If you need any more clarification let me know.


#2

Why do you want to hide it before the event ends?


#3

Have you ever looked at Soundclouds native app? On the waveform, when you are scrolling through the song, a div appears with the time on it your scrolling through. Once you are finished then it closes.

I’ve figured it out. I’m just using basic event listeners in Javascript. Weird that mouse events work and touch events don’t work though.