Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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

Description

@daniloarcidiacono

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions