From 023d7794adb3225333336db56a0b5b39007ebe1c Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 25 Aug 2021 10:03:17 +0300 Subject: [PATCH] Fixed #1337 - input mask - mask affecting dirty state --- src/components/inputmask/InputMask.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/inputmask/InputMask.vue b/src/components/inputmask/InputMask.vue index ebbb795f5..896cc5638 100755 --- a/src/components/inputmask/InputMask.vue +++ b/src/components/inputmask/InputMask.vue @@ -392,11 +392,11 @@ export default { let val = this.unmask ? this.getUnmaskedValue() : e.target.value; this.$emit('update:modelValue', (this.defaultBuffer !== val) ? val : ''); }, - updateValue() { + updateValue(updateModel = true) { if (this.$el) { if (this.modelValue == null) { this.$el.value = ''; - this.$emit('update:modelValue', ''); + updateModel && this.$emit('update:modelValue', ''); } else { this.$el.value = this.modelValue; @@ -407,8 +407,10 @@ export default { this.writeBuffer(); this.checkVal(); - let val = this.unmask ? this.getUnmaskedValue() : this.$el.value; - this.$emit('update:modelValue', (this.defaultBuffer !== val) ? val : ''); + if (updateModel) { + let val = this.unmask ? this.getUnmaskedValue() : this.$el.value; + this.$emit('update:modelValue', (this.defaultBuffer !== val) ? val : ''); + } } }, 10); } @@ -468,7 +470,7 @@ export default { } } this.defaultBuffer = this.buffer.join(''); - this.updateValue(); + this.updateValue(false); }, updated() { if (this.isValueUpdated()) {