vue-input-facade
vue-input-facade copied to clipboard
Cannot set null value in v-model fields with mask array v-mask="['###.###.###-##', '##.###.### / ####-##']"
Describe the bug
When using a mask array in the v-mask directive, it is not possible to set a null value in the v-model. This makes it impossible to reset the form data.
Example of using the mask:
<input v-model="CpfCnpj" type="text" v-mask="['###.###.###-##', '##.###.###/####-##']" />
<button @click="CpfCnpj = null"> Clear </button>
To Reproduce Steps to reproduce the behavior:
- Use a mask array in the mask directive as in the example: v-mask="['###.###.###-##', '##.###.###/## ##-##']"
- set value in v-model ex:
<button @click="CpfCnpj = 00133266545"> Set Value </button>
- Set a null value in the v-model of the component where the mask array is used.
<button @click="CpfCnpj = null"> Clear </button> - When setting null value in v-model, it is not applied.
Expected behavior It must be possible to set a null value in the v-model that has the mask array
Desktop (please complete the following information):
- OS: Microsoft Windows 11 Pro - v 10.0.22000 - 22000
- Browser [Chrome]
- Version [v 104.0.5112.82 - 64 bits]
Additional context Only the component that uses a mascara array doesn't allow to set null value in v-model. So correctly a form is impossible.
I was unable to reproduce this on both chrome or safari, setting to null worked fine in the demo page.

I am having this problem. Here is my attempt to reproduce. https://codepen.io/MatthewAry/pen/MWXOzJV
i am having the same problem with vuetify