Skip to content

Commit

Permalink
Check placeholder value when setting dirty state.
Browse files Browse the repository at this point in the history
  • Loading branch information
Garbee authored Jun 27, 2017
1 parent df6196d commit b848826
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/textfield/textfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@
* @public
*/
MaterialTextfield.prototype.checkDirty = function() {
if ((this.input_.value && this.input_.value.length > 0) || this.input_.placeholder) {
var placeholder = this.input_.placeholder;
if (
(this.input_.value && this.input_.value.length > 0) ||
(placeholder !== undefined || placeholder.trim() !== "")
) {
this.element_.classList.add(this.CssClasses_.IS_DIRTY);
} else {
this.element_.classList.remove(this.CssClasses_.IS_DIRTY);
Expand Down

0 comments on commit b848826

Please sign in to comment.