ditdot-dev / vue-flow-form

Create conversational conditional-logic forms with Vue.js.
https://www.ditdot.hr/en/vue-flow-form
MIT License
785 stars 175 forks source link

Bug:incorrect email validation expression #219

Closed ztxone closed 3 years ago

ztxone commented 3 years ago

Describe the bug QuestionTypes/EmailType.vue regex doesn't correct check email rules

To Reproduce When typing email it validates input with incorrect email for example aaa@aa - and it lets go next step.

Expected behavior Expecting correct validation of input type=email

Additional context Feels comfortable with expression like this: /^[\w-.]+@([\w-]+.)+[\w-]{2,8}$/

spinn commented 3 years ago

Hi @ztxone,

email validation is incredibly complex so that is why we went with the simplest solution - it's better to pass through some invalid email addresses than the opposite. aaa@aa is a valid email address - ICANN does discourage dotless email addresses but they're still valid (and a TLD can be two characters long).

To help you accomplish what you need, in a future version we'll allow for defining custom validation methods that will allow you to alter the validation of all field types.

ztxone commented 3 years ago

Ok. Thanks for explanation!

danielcharrua commented 2 years ago

Hello @spinn @ztxone any updates on custom validation on email fields?

Thanks.