Open samik3k opened 6 years ago
Same problem
It' look like mask work wrong, when send model data back to input.
Example I have mask ="+\9\6\2 111-11-11" and enter number + 962 333-33-33. After save correct number, and then try edit, and put data back to input - result is + 962 962-33-33. It's not cut static numbers at beginning.
Solution can be to save raw value@input="rawVal = arguments[1]"
and use it.
Or in my case, I just cut static start of mask
<masked-input v-model="userPhone" mask="\+\9\6\2 / 11 / 111/ 1111" placeholder="Phone"/>
data() {
return {
phone: '',
},
computed: {
userPhone: {
set(val) {
this.phone = val;
},
get() {
return this.phone.substring(4);
},
},
}
Same problem
It can be fixed by replacing in MaskedInput.js this line
[...this.$refs.input.value].reduce((memo, item) => this.maskCore.input(item), null);
with
this.maskCore.paste(this.$refs.input.value);
So i have
And i have phone: '72731241241', Every time i open this modal i will get +7 727 312-41-24 Next try +7 772 731-24-12 And next +7 777 273-12-41 And next +7 777 727-31-24...