Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

[1.5.9] NgModel set value undefined in input number with decimal #15257

Closed
YokiToki opened this issue Oct 13, 2016 · 1 comment
Closed

[1.5.9] NgModel set value undefined in input number with decimal #15257

YokiToki opened this issue Oct 13, 2016 · 1 comment

Comments

@YokiToki
Copy link

YokiToki commented Oct 13, 2016

No set undifined only for 0.1, 0.2, 0.4, 0.8, 0.16, 0.32....

In 4999 - 5060 bower-angular builds

https://plnkr.co/edit/CMvhwlRFNSMGVKN0RAVH?p=preview

image

@gkalpak
Copy link
Member

gkalpak commented Oct 13, 2016

This is a valid bug. Thx @YokiToki 👍

Explanation:

One of the validations rules we use for [step] is <value> % <step> === 0. But there are cases, where (x * y) % x !== 0 (e.g. 0.5 % 0.1 === 0.09999999999999998 !== 0). In such cases, ngModelController considers the input value invalid (and sets the model value to undefined).

Affected versions/controls:

  1. v1.5.9 (to-be-released): It will affect input[type="range"][ng-input-range] elements on browsers that don't natively support range inputs.
  2. v1.6.0-rc.0 (to-be-released): It will affect input[type="number"] elements on all browsers and input[type="range"] elements on browsers that don't natively support range inputs.

@gkalpak gkalpak added this to the 1.5.x milestone Oct 13, 2016
gkalpak added a commit to gkalpak/angular.js that referenced this issue Oct 13, 2016
@Narretz Narretz changed the title [1.5.9] NgModel set value undifined in input number with decimal [1.5.9] NgModel set value undefined in input number with decimal Oct 14, 2016
Narretz pushed a commit to Narretz/angular.js that referenced this issue Oct 17, 2016
gkalpak added a commit that referenced this issue Oct 19, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2016
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2016
This reverts commit 90c08b8
feat(input): re-add support for binding to `input[range]`

This commit re-applies the related (previously reverted) commits. A follow-up
commit will make the support opt-in in order to avoid a breaking change.

Included commits:

- 296da4b - `feat(input): add support for binding to input[type=range]`
  (previously reverted with 6a167e8)

- b78539b - `fix(input[range]): correctly handle min/max; remove ngMin/ngMax support`
  (previously reverted with aa60491)

- 90c08b8 - `feat(input[range]): support step`
  (previously reverted with 5b633d8)
fix(input): fix `step` validation for `input[number][ng-range-input]`

Related to 9a8b8aa and angular#15257. Fixes the issue discussed in
angular@9a8b8aa#commitcomment-19108436.

Fixes angular#15257

Closes angular#15264
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2016
petebacondarwin pushed a commit that referenced this issue Nov 23, 2016
petebacondarwin pushed a commit that referenced this issue Nov 24, 2016
ellimist pushed a commit to ellimist/angular.js that referenced this issue Mar 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants