Kendo-angular: Numerictextbox TypeError: e.toFixed is not a function

Created on 25 Jan 2018  路  3Comments  路  Source: telerik/kendo-angular

I'm submitting a...

  • Bug report

Current behavior


Component throws a TypeError: e.toFixed is not a function when min/max input is bound to string and value is populated with min/max value through spinner buttons.

Expected behavior


Cast to number or validate min/max inputs.

Minimal reproduction of the problem with instructions

@progress/[email protected]
Bug inputs

Most helpful comment

Yes, it's easy in this simple example. But in my project I have 100+ kendo-numerictextbox component and some of them are bound to variables that came from API calls and it's hard to figure out which component's min/max is bound to string. So I hope you'll implement the explicit parse to Number 馃檹

All 3 comments

Indeed, the component doesn't parse the input explicitly as it expects to receive Number value:

https://www.telerik.com/kendo-angular-ui-develop/components/inputs/api/NumericTextBoxComponent/#toc-min
The required type is number.

Unfortunately, the min="2" property definition will set the min value to string value.

The workaround in this case is just to use the min Input property instead:

<kendo-numerictextbox [value]="value" [min]="2">
</kendo-numerictextbox>

Yes, it's easy in this simple example. But in my project I have 100+ kendo-numerictextbox component and some of them are bound to variables that came from API calls and it's hard to figure out which component's min/max is bound to string. So I hope you'll implement the explicit parse to Number 馃檹

Fixed in v2.1.0-dev.201802021248

Was this page helpful?
0 / 5 - 0 ratings