diff --git a/src/components-examples/material/form-field/form-field-custom-control/form-field-custom-control-example.ts b/src/components-examples/material/form-field/form-field-custom-control/form-field-custom-control-example.ts index 2c0f4bc39674..c1348bf549ce 100644 --- a/src/components-examples/material/form-field/form-field-custom-control/form-field-custom-control-example.ts +++ b/src/components-examples/material/form-field/form-field-custom-control/form-field-custom-control-example.ts @@ -13,6 +13,7 @@ import { input, model, signal, + untracked, viewChild, } from '@angular/core'; import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; @@ -175,19 +176,20 @@ export class MyTelInput implements ControlValueAccessor, MatFormFieldControl this.stateChanges.next()); }); effect(() => { if (this._disabled()) { - this.parts.disable(); + untracked(() => this.parts.disable()); } else { - this.parts.enable(); + untracked(() => this.parts.enable()); } }); effect(() => { - this.parts.setValue(this._value() || new MyTel('', '', '')); + const value = this._value() || new MyTel('', '', ''); + untracked(() => this.parts.setValue(value)); }); this.parts.statusChanges.pipe(takeUntilDestroyed()).subscribe(() => {