Fix textfield non-empty class with value zero

This commit is contained in:
Joan Sanchez 2018-06-20 14:53:24 +02:00
parent 25d9655c0c
commit 101d8875a9
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ export default class Textfield extends Input {
set value(value) {
this._value = (value === undefined || value === '') ? null : value;
this.input.value = this._value;
this.hasValue = Boolean(this._value);
this.hasValue = this._value !== null;
if (this.hasValue) this.element.classList.add('not-empty');
else this.element.classList.remove('not-empty');
this.mdlUpdate();