Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
map invalid view state directly to invalid property
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Miles committed Jun 12, 2014
1 parent 902c443 commit cb628c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,12 @@
} else if (this.validate instanceof Function) {
valid = this.validate.call(this.inputValue);
}

this.invalid = !valid;
this.classList.toggle('invalid', !valid);
},

if (!valid) {
invalidChanged: function() {
this.classList.toggle('invalid', this.invalid);
if (this.invalid) {
this.fire('input-invalid', {value: this.inputValue});
}
},
Expand Down

0 comments on commit cb628c8

Please sign in to comment.