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

Commit cb628c8

Browse files
author
Scott Miles
committed
map invalid view state directly to invalid property
1 parent 902c443 commit cb628c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core-input.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@
201201
} else if (this.validate instanceof Function) {
202202
valid = this.validate.call(this.inputValue);
203203
}
204-
205204
this.invalid = !valid;
206-
this.classList.toggle('invalid', !valid);
205+
},
207206

208-
if (!valid) {
207+
invalidChanged: function() {
208+
this.classList.toggle('invalid', this.invalid);
209+
if (this.invalid) {
209210
this.fire('input-invalid', {value: this.inputValue});
210211
}
211212
},

0 commit comments

Comments
 (0)