An issue arises when using a specific type of input in angularjs (1.6.1) where the values between 9.03
to 9.05
inclusively return undefined
. This problem also occurs with other values like 9.62
, 9.63
, and 17.31
.
<input type="number" step="0.01" data-ng-model="$ctrl.numericValue" />
You can see this issue replicated in this fiddle. Just click up in the numeric input.
Testing was done on Firefox and Chromium under Linux Mint 18.
The problem seems to be related to the "step"
attribute. When it's set to "0.001"
, there is no problem. However, for this application, it is critical to have 2 decimal places.
Note: If the value is initially set to 9.03
via data-numeric-value
, it does not result in undefined
.
Are there any workarounds for this bug?
Edit
An updated fiddle showcases the behavior with step="0.01"
versus step="0.001"
.
Edit 2 I created a Plunkr while submitting a bug report and discovered that the bug was fixed in the "snapshot" version, which is 1.6.2. Unfortunately, this version is currently unavailable for download from the AngularJS website.