| 393 | |
| 394 | it('should sync the disabled state if it changes right after a group is re-bound', async () => { |
| 395 | @Component({ |
| 396 | imports: [FormsModule, ReactiveFormsModule, CommonModule], |
| 397 | template: ` |
| 398 | <form [formGroup]="form()"> |
| 399 | <input formControlName="input" /> |
| 400 | </form> |
| 401 | `, |
| 402 | }) |
| 403 | class App { |
| 404 | form = signal<FormGroup>(null!); |
| 405 | |
| 406 | constructor(private _fb: FormBuilder) { |
| 407 | this.form.set(this._getForm()); |
| 408 | } |
| 409 | |
| 410 | private _getForm() { |
| 411 | return this._fb.group({'input': 'value'}); |
| 412 | } |
| 413 | |
| 414 | recreateAndDisable() { |
| 415 | const nextForm = this._getForm(); |
| 416 | nextForm.disable(); |
| 417 | this.form.set(nextForm); |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | const fixture = initTest(App); |
| 422 | await fixture.whenStable(); |