fix(forms): mark control containers as touched when child controls are touched (#9735)
This commit is contained in:
@@ -120,7 +120,14 @@ export abstract class AbstractControl {
|
||||
|
||||
clearValidators(): void { this.validator = null; }
|
||||
|
||||
markAsTouched(): void { this._touched = true; }
|
||||
markAsTouched({onlySelf}: {onlySelf?: boolean} = {}): void {
|
||||
onlySelf = normalizeBool(onlySelf);
|
||||
this._touched = true;
|
||||
|
||||
if (isPresent(this._parent) && !onlySelf) {
|
||||
this._parent.markAsTouched({onlySelf: onlySelf});
|
||||
}
|
||||
}
|
||||
|
||||
markAsDirty({onlySelf}: {onlySelf?: boolean} = {}): void {
|
||||
onlySelf = normalizeBool(onlySelf);
|
||||
|
||||
Reference in New Issue
Block a user