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 [checkbox] ng-true-value="1" required - never validates #4681

Closed
@penfold

Description

@penfold

Following changes from 1.2rc2 to 1.2rc3, the behaviour of the checkbox has changed.

An element:

<input type="checkbox" ng-model="terms" ng-true-value="1" required>Check me</input>

Is not valid when it is checked. The function on the checkboxInputType controller function:

  ctrl.$isEmpty = function(value) {
    return value !== trueValue;
  };

Is getting passed value=true when the checkbox is checked. Therefore, the required validation is failing. (true !== "1" is true).

Browser: Chrome & FireFox (latest builds)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions