#865 hacer que los eventos de guardado funcionen correctamente

This commit is contained in:
Gerard 2018-11-26 09:53:34 +01:00
parent e60d485111
commit 5f4dfe6d75
1 changed files with 8 additions and 2 deletions

View File

@ -30,13 +30,19 @@ export default class Textfield extends Input {
});
this.input.addEventListener('blur', () => {
if (this.onChange && !this.cancelled && (this.oldValue != this.value))
if (this.onChange && !this.cancelled && (this.oldValue != this.value)) {
this.onChange();
else
this.saveOldValue();
} else
this.cancelled = false;
});
}
$postLink() {
this.saveOldValue();
console.log(this.value, this.oldValue);
}
saveOldValue() {
this.oldValue = this.value;
}