We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mask.completed returns false if the mask contains optional tokens
mask.completed
I inserted the optional token 0 and expect the method returns true
0
true
const mask = new Mask({ mask: "#-#0", tokens: { "0": { pattern: /[0-9]/, optional: true }, }, }) mask.completed("12") // = false
https://stackblitz.com/edit/js-maska-k9z3pf?file=index.js
The text was updated successfully, but these errors were encountered:
Yeah I'm facing the same issue trying to implement this:
v-maska data-maska="(##)########0" data-maska-tokens="0:[0-9]:optional"
The completed event only fires with all the values inserted. Are we misunderstanding the optional usage @beholdr?
completed
optional
Sorry, something went wrong.
Same happening here but with an array of masks. It only returns completed after filling the larger one.
https://stackblitz.com/edit/vue-maska-kwct9s?file=src%2FApp.vue
I'm afraid it's too complicated logic to determine which token is optional. It's just checking mask length.
No branches or pull requests
Describe the bug
mask.completed
returns false if the mask contains optional tokensI inserted the optional token
0
and expect the method returnstrue
Steps to reproduce
Reproduction link
https://stackblitz.com/edit/js-maska-k9z3pf?file=index.js
The text was updated successfully, but these errors were encountered: