v-mask
v-mask copied to clipboard
? Optional Character Adding Additional Character
V-Mask and Vue versions
2.0.2, 2.6.10
Reproduction Link
https://jsfiddle.net/a07teqLf/1/
Steps to reproduce
- Enter '1/9/2020' into the text field with mask value of '#?#/#?#/####'
- Observe additional '/' being added after / is typed.
What is Expected?
I would expect based on the documentation that it would format to 1/9/2020
What is actually happening?
1//9//2020 is the masked value.
I dont know if this is intended functionality but it doesn't seem to allow a date format from the ##/##/#### mask value.
Same here.
Is theree some workaround? please, help!

Same here...
Is this same issue? https://github.com/probil/v-mask/issues/503
Also tried to use [/\d/, /\d?/, /\./, /\d/, /\d?/, /\./, /\d/, /\d/, /\d/, /\d/] to achieve mask pattern '#?#.#?#.####'.
However, trying to input '1.12.2022' resulted in '1..12.2022'
@probil any chances you would have time to look for a bug fix for this?
It seems possible you could close several issues with one fix, as this issue with Regex pattern array resulted in similar misbehavior with static characters :)
Just wanted to comment and say that this is till an issue on version 2.2.4.
I'm was trying to create a temperature mask (##?#.#) so that a user could either type in 1000 and get 100.0 or if they were to type 98.6 they would get 98.6. However, when typing 98.6 I ended up with 98..6
As a workaround (maybe not the best), add your v-model to a watch and remove the extra dot:
watch: { vmodel: function() { this.vmodel.replace("..","."); } }