Skip to content

Commit

Permalink
fix(input): don't perform HTML5 validation on updated model-value
Browse files Browse the repository at this point in the history
Running html5-validation immediately after model-value is updated is incorrect, because the view
has not updated, and HTML5 constraint validation has not adjusted. This should be properly fixed
later on by performing html5 validation after the view value is updated, and a comment has been
left to address this in the future.

Closes angular#6796
  • Loading branch information
caitp committed Mar 23, 2014
1 parent 635cdaa commit 0c428e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ function addNativeHtml5Validators(ctrl, validatorName, element) {
return value;
};
ctrl.$parsers.push(validator);
ctrl.$formatters.push(validator);
// TODO: perform HTML5 validation after $formatters are run and $viewValue updated
}
}

Expand Down

0 comments on commit 0c428e3

Please sign in to comment.