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.

Input type="number" invalid on load if ng-required is used #9106

Closed
@greglockwood

Description

@greglockwood

A regression has occurred in Angular version 1.3.0-rc.1 where using ng-required on an input with type="number" results in incorrect behaviour on initialisation.

The issue is that regardless of what the ng-required expression returns, the input is marked as having an invalid number when it is empty due to being bound to a non-existent property.

I have reproduced this with a Plunkr, which shows output like so:
image

I was able to have a hacky workaround locally by creating a directive that would shift() the badInputChecker parser function from the start of the ngModelController.$parsers array, and push it onto the end instead. Thus it is likely related to the fact that the badInputChecker is added as the first parser function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions