Ion Range Slider Change Event

I’m using a range slider for some of my form input.

Something like this:

<'ion-range (change)=“updateResults();” dualKnobs=“true” pin=“true” formControlName=“myInput” min=“1” max=“28” step=“1” snaps=“true”>
But the (change) isn’t firing.

updateResults() then emits all the form input in my .ts file.

How can I fire an event every time an ion-range input changes?

1 Like

(change) is the not the event name anymore, it has been updated. Please take a look at the docs

4 Likes

Works like a dream - thanks!

Hey, I wonder what happened to these docs? Now they list no events at all, other than this ionChange event?..can this still be done? I want to use the range slider as a seek bar for my audio, so when I release the range handle I want to get the value, not before…

UPDATE: debounce=“700” works check out this post

the docs still don’t make this clear, so now do we use (ratio)=“myFunc()”… or what…
I may seem like an absolute noob but i still cant really figure out how i access the variable a range slider produces in my typescript.

Try (ionChange) event

<ion-range [(ngModel)]=“sliderValue” color=“danger” pin=“true” (ionChange)=“change()”>

2 Likes

Perfect thank you! this works (just so others know aswell)

Works like a charm. @mhartington: the doc needs updating to show ionChange!!

Regards

Tom

So I have a midi player. What if it’s not the app changing the value of ion-range but the user changing the value?

1 Like

that should trigger the ionChange

You can also use (ionBlur) to capture event after user stops moving the knob

4 Likes

To update label on range update, and update list only after user stops.

<ion-range [min]=“min” [max]=“max” [(ngModel)]=“salaryRange” (ngModelChange)=“setLabel()” (ionBlur)=“handleChange()” color=“secondary”>