-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report
Description
Bug Report
Ionic version:
[x] 4.x
Current behavior:
The type of the ion-range value is always RangeValue ({ lower: number; upper: number; }).
Type 'RangeValue' is not assignable to type 'number'.
Type '{ lower: number; upper: number; }' is not assignable to type 'number'.ts(2322)
Expected behavior:
But by the docs it should be number OR RangeValue (number | { lower: number; upper: number; })
Steps to reproduce:
Create a ion-range and append ionChange event. Please see related code...
Related code:
html
<ion-range
(ionChange)="onRangeChange($event)"
[min]="min"
[max]="max"
debounce="500"
></ion-range>ts (error visible, see Current behavior section.)
onRangeChange(event: IonRange) {
this.value = event.value;
}Other information:
Workaround: Cast to number. But maybe it's unsafe.
I think it's just a type definition issue.
Ionic info:
Ionic CLI : 5.2.8
Ionic Angular : 4.9.1
NodeJS : v10.15.3
npm : 6.4.1
OS : Windows 10
VSCode : 1.38.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report