Skip to content

Forms - required but empty type=number still valid #8048

@MichaelChambers

Description

@MichaelChambers

For this plunk: http://plnkr.co/edit/0UAKr1OGulovFUefmMDt?p=preview
I edited the forms example plunk to add a new number property, strength.

Removing the 80 strength value changes
spy.className to: form-control ng-valid ng-dirty ng-touched
strength.valid: true
strength.pristine: false

I thought it would change it to ng-invalid
If on the HTML's line 36 I change the input's type to text instead, and then remove the 80 strength, then I get the expected behavior of ng-invalid

spy.className: form-control ng-dirty ng-invalid ng-touched
strength.valid: false
strength.pristine: false

Using Chrome and 2.0.0-beta.14

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