Skip to content

Commit

Permalink
fix: markAllDirty(FormGroup) not marking children
Browse files Browse the repository at this point in the history
FormControl doesn't have a markAllAsDirty method

Closes #135
  • Loading branch information
shajz committed Jan 3, 2022
1 parent 45cfe2b commit 5dcab34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/reactive-forms/src/lib/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,5 @@ export function controlErrorChanges$(
export function markAllDirty(control: AbstractControl): void {
control.markAsDirty({ onlySelf: true });

(control as any)._forEachChild((control: any) => control.markAllAsDirty?.());
(control as any)._forEachChild((control: any) => control.markAllAsDirty?.() || control.markAsDirty({ onlySelf: true }));
}

0 comments on commit 5dcab34

Please sign in to comment.