From 6521d5bc141fbdd86a7f02159a7c55f943949acc Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 6 Mar 2024 14:18:34 +0100 Subject: [PATCH] fix(material/core): mark fields on HasErrorState as nullable Updates a couple of the fields on `HasErrorState` to be nullable to align them with the `_ErrorStateTracker`. Fixes #28688. --- src/material/core/common-behaviors/error-state.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/material/core/common-behaviors/error-state.ts b/src/material/core/common-behaviors/error-state.ts index 88aeb448b4f3..e20993553291 100644 --- a/src/material/core/common-behaviors/error-state.ts +++ b/src/material/core/common-behaviors/error-state.ts @@ -33,14 +33,14 @@ type CanUpdateErrorStateCtor = Constructor & /** @docs-private */ interface HasErrorState { - _parentFormGroup: FormGroupDirective; - _parentForm: NgForm; + _parentFormGroup: FormGroupDirective | null; + _parentForm: NgForm | null; _defaultErrorStateMatcher: ErrorStateMatcher; // These properties are defined as per the `MatFormFieldControl` interface. Since // this mixin is commonly used with custom form-field controls, we respect the // properties (also with the public name they need according to `MatFormFieldControl`). - ngControl: NgControl; + ngControl: NgControl | null; stateChanges: Subject; }