Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Angular Email Validation Incorrect #11510

Closed
CreativelyMe opened this issue Apr 4, 2015 · 1 comment
Closed

Angular Email Validation Incorrect #11510

CreativelyMe opened this issue Apr 4, 2015 · 1 comment

Comments

@CreativelyMe
Copy link

The email validation for Angular 1.3.15 is incorrect.

As soon as the first letter after the @ is typed, the email validates.

This allows emails that look like Joe@C to validate without a period or a domain extension.

I noticed that a similar issue was raised before and closed, but it does not work correctly in the latest version of Chrome, Firefox, IE, or Opera.

There seemed to be a lot of discussion in the closed issue around whether or not a domain extension was a requirement for an email address.

In my opinion, I think the production use cases where a domain extension is not required are likely to be such edge cases that it makes more sense to use input type text for those edge cases, and allow the email type to function as most developers would expect it to work.

@Narretz
Copy link
Contributor

Narretz commented Apr 4, 2015

This comes up very often. But as you said yourself, an email address without a domain is valid. It's just that for many apps, it's useful if it was required.
So your title is not correct. The email validation is correct. If you think this behavior should be configurable, please open a new issue that is rewritten as a feature request, 1.5 is a good occasion to put this up for debate (again) Meanwhile, you can use the pattern/ngPattern directive to add an additional constraint to your validation. Or even overwrite the original email validator: https://docs.angularjs.org/guide/forms

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants