File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -357,14 +357,14 @@ ngDoCheck() {
357357}
358358
359359private updateErrorState () {
360- const parent = this ._parentFormGroup || this .parentForm ;
360+ const parentSubmitted = this ._parentFormGroup ?.submitted || this ._parentForm ?.submitted ;
361+ const touchedOrParentSubmitted = this .touched || parentSubmitted ;
361362
362- const oldState = this .errorState ;
363- const newState = (this .ngControl ?.invalid || this .parts .invalid ) && (this .touched || parent .submitted );
363+ const newState = (this .ngControl ?.invalid || this .parts .invalid ) && touchedOrParentSubmitted ;
364364
365- if (oldState !== newState ) {
365+ if (this . errorState !== newState ) {
366366 this .errorState = newState ;
367- this .stateChanges .next ();
367+ this .stateChanges .next (); // Notify listeners of state changes.
368368 }
369369}
370370```
You can’t perform that action at this time.
0 commit comments