ditdot-dev/vue-flow-form

Bug:mask with array

matheusf31 opened this issue · 1 comments

Describe the bug
If I use the mask in new QuestionModel with an array like this: mask: ['###.###.###-##', '###.###.###/#####'] the input don't work appropriately. They recognize just 2 numbers and don't recognize the format of the mask that was expected (###.###.###-## or ###.###.###/#####).

To Reproduce
Clone and run the vue-flow-form and in file examples/questionnaire/Example.vue change the fisrt question to this:

new QuestionModel({
  id: 'first_name',
  tagline: 'Hi! Welcome to our demo survey 😊',
  title: 'CPF?',
  type: QuestionType.Phone,
  required: true,
  mask: ['###.###.###-##', '###.###.###/#####'],
}),

Expected behavior
I expect to be able to press ok if the format is correct in the both cases of the mask (###.###.###-## or ###.###.###/#####).

Screenshots
image
image
image
image

Desktop (please complete the following information):

  • Device: PC
  • OS: Windows 10
  • Browser: chrome
  • Version: 88.0.4324.150 64 bits
spinn commented

Thank you for the extensive bug report and the example you provided. This issue has been fixed in commit 3fedfcd, but this change now unfortunately revealed a bug in vue-the-mask:

vuejs-tips/vue-the-mask#64

We'll either have to find a suitable replacement for vue-the-mask, or fork it to fix the issue.