ditdot-dev / vue-flow-form

Create conversational conditional-logic forms with Vue.js.

Home Page:https://www.ditdot.hr/en/vue-flow-form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug:incorrect email validation expression

ztxone opened this issue · comments

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}$/

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.

Ok. Thanks for explanation!

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

Thanks.