Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2 range touchend event

I´m trying to get the value of a range slider with Ionic 2 at the end of an input.

In the doumentation the only availible event is the ionChange, which triggers several times during an input, and I only need the last value to perform an action.

I tried to add the touchend event manually but the event is ignored.

Here´s also a Plunker with the Problem.

<ion-range (ionChange)="showVal($event)" (touchend)="presentValue(event)" min="0" max="100" [(ngModel)]="currentTime" color="danger">
          <ion-icon small range-left name="sunny"></ion-icon>
          <ion-icon range-right name="sunny"></ion-icon>
     </ion-range>

Does anybody know a way to listen to an touchend event on the range slider in Ionic 2?

like image 347
user3333128 Avatar asked Jun 28 '26 06:06

user3333128


1 Answers

There is also the ionBlur and ionFocus event on the range input you could use.

The ionFocus fires when you are sliding through the range and the ionBlur is fired when you have released the range item

<ion-range (ionBlur)="rangeBlurred($event)" (ionFocus)="rangeFocused($event)">
like image 177
J.Tobi Avatar answered Jul 02 '26 03:07

J.Tobi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!