Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(input): error states and improved for input fields
Browse files Browse the repository at this point in the history
Closes #1485, #1633, #1629.
  • Loading branch information
ThomasBurleson committed Feb 26, 2015
1 parent 50b5d92 commit 747eb9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ function inputTextareaDirective($mdUtil, $window) {

// Error text should not appear before user interaction with the field.

This comment has been minimized.

Copy link
@rinoldit

rinoldit Apr 17, 2018

What the case if error text should appear not when touched but after dirty?

// So we need to check on focus also
ngModelCtrl.$setTouched();
if ( isErrorGetter() ) containerCtrl.setInvalid(true);
//ngModelCtrl.$setTouched();
//if ( isErrorGetter() ) containerCtrl.setInvalid(true);
scope.$digest();

This comment has been minimized.

Copy link
@gkalpak

gkalpak Feb 27, 2015

Member

Are you sure a $digest is enough ?
What if I want to update an element (error message, submit button, etc) that is in a sibling scope ?

I think $apply is more appropriate here.


})
.on('blur', function(ev) {
Expand Down

0 comments on commit 747eb9c

Please sign in to comment.