Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forms): make Validators.email support optional controls #20869

Closed

Conversation

pmccloghrylaing
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

Don't appear to be any docs in need of updating.

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Empty inputs with the email validator are invalid.

Issue Number: #16183

What is the new behavior?

Empty inputs with the email validator are valid unless they also have the required validator.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Applications will continue to work with this change, however any applications that relied on the email validator treating empty as invalid will need to be updated to also include the required validator.

Other information

#16276 and #16902 have been sitting unmerged for months - I've included changes from both in order to try to get this bug fix in.

Bring email validator in line with other validators so that empty values are ignored.
@abdel-ships-it
Copy link

Someone please merge this PR.

@kara kara added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Feb 7, 2018
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kara
Copy link
Contributor

kara commented Feb 7, 2018

presubmit

@kara kara added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 7, 2018
@kara kara removed their assignment Feb 7, 2018
@mhevery mhevery closed this in 140e7c0 Feb 7, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
…20869)

Bring email validator in line with other validators so that empty values are ignored.

PR Close angular#20869
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
…20869)

Bring email validator in line with other validators so that empty values are ignored.

PR Close angular#20869
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: forms cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants