Skip to content

fix(forms): support nullable string in email and pattern validators#68855

Open
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:docs/signal-forms-unions-guide
Open

fix(forms): support nullable string in email and pattern validators#68855
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:docs/signal-forms-unions-guide

Conversation

@BHUVANSH855
Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added
  • Docs have been added / updated

PR Type

What kind of change does this PR introduce?

  • 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.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

email() and pattern() only accept SchemaPath<string, ...> types, which causes TypeScript errors when optional fields are represented as string | null.

Issue Number: #66539

What is the new behavior?

Updates email() and pattern() validators to support nullable string paths.

A type test was also added to verify usage with string | null.

Runtime behavior is unchanged because nullable values were already treated as empty values.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

None.

@pullapprove pullapprove Bot requested a review from JeanMeche May 21, 2026 14:06
@ngbot ngbot Bot added this to the Backlog milestone May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant