maska
maska copied to clipboard
Unexpected behavior with "(##) 9####-####" mask
I'm trying to add a mask to a phone input in Brazilian format. So I'm using (##) 9####-####
as the mask, but the input after (##) 9
does not accept any number other than 9:
I also use it for Brazilian standard, what I did was simply pass an array with I want the mask to apply to the input
Ex: ['(##) ####-####', '(##) #####-####']
I can confirm this. One option:
<input v-maska="{ mask: '(##) Z ####-####', tokens: { 'Z': { pattern: /[9-9]/ }}}" class="form-control" placeholder="Ex: (41) 9 91233-4567" type="text">
Should be fixed with v2
@beholdr if I use the following example, the method completed return wrong https://codesandbox.io/s/maska-i37oj7
import { Mask } from "maska";
const mask = new Mask({ mask: ["(##) ####-####", "(##) #####-####"] });
const value = "(64) 3453-3469";
const obj = {
value: value,
masked: mask.masked(value),
unmasked: mask.unmasked(value),
isValid: mask.completed(value)
};
mask.completed it should return true, but return false.