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

ng-model randomly yields undefined when applied to input[type="number"] #15552

Closed
daniloarcidiacono opened this issue Dec 28, 2016 · 1 comment

Comments

@daniloarcidiacono
Copy link

daniloarcidiacono commented Dec 28, 2016

Do you want to request a feature or report a bug?
Bug.

What is the current behavior?
When using ng-model on a simple input tag:

<input type="number" 
             step="0.01"
             data-ng-model="ctrl.myValue">

for some values (eg. 9.45 but not, say, 9.44) ctrl.myValue is set to undefined.
I created a plunker to better explain this issue.

What is the expected behavior?
The model variable should never be set to undefined for valid numbers.

What is the motivation / use case for changing the behavior?
It's most likely a bug.

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
As the plunker shows, this bug affects only the latest versions (>= 1.6.0).

@daniloarcidiacono
Copy link
Author

daniloarcidiacono commented Dec 28, 2016

Ok, it seems that the step attribute is the culprit, as explained in #15504 and #15506.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant