Skip to content

Commit

Permalink
Fixed #290 - InputMask somehow clears the initial value to empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 24, 2020
1 parent 9421398 commit 8dd0612
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/components/inputmask/InputMask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,22 @@ export default {
if (this.$el) {
if (this.value == null) {
this.$el.value = '';
this.$emit('input', '');
}
else {
this.$el.value = this.value;
this.checkVal();
}
setTimeout(() => {
if(this.$el) {
this.writeBuffer();
this.checkVal();
setTimeout(() => {
if (this.$el) {
this.writeBuffer();
this.checkVal();
let val = this.unmask ? this.getUnmaskedValue() : this.$el.value;
this.$emit('input', (this.defaultBuffer !== val) ? val : '');
}
}, 10);
let val = this.unmask ? this.getUnmaskedValue() : this.$el.value;
this.$emit('input', (this.defaultBuffer !== val) ? val : '');
}
}, 10);
}
this.focusText = this.$el.value;
}
Expand Down Expand Up @@ -488,4 +489,4 @@ export default {
},
}
}
</script>
</script>

0 comments on commit 8dd0612

Please sign in to comment.