馃悶 bug report
Affected Package
The issue is caused by package @angular/forms
Description
I have simple reactive form with some input fields.
The method form.disable() is called to disable the form and all fields.
The method works, as all input fields in the UI are now disabled.
Expected
The property form.disabled should be true as the form is disabled now.
Actual
The property form.disabled is false.
Cause of the problem
After building the form, I subscribe to control f1 and update the value of another control whenever f1 changes.
this.myForm.controls.f1
.valueChanges
.subscribe(() => this.testMethod());
testMethod() {
this.myForm.controls.f3.setValue('test');
}
Workaround
It works when I call form.disable() twice.
馃敩 Minimal Reproduction
https://stackblitz.com/edit/angular-issue-repro2-g8725l
馃實 Your Environment
Angular Version:
Angular CLI: 7.3.5
Node: 10.14.1
OS: win32 x64
Angular: 7.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.13.5
@angular-devkit/build-angular 0.13.5
@angular-devkit/build-optimizer 0.13.5
@angular-devkit/build-webpack 0.13.5
@angular-devkit/core 7.3.5
@angular-devkit/schematics 7.3.5
@angular/cdk 7.3.4
@angular/cli 7.3.5
@angular/material 7.3.4
@angular/material-moment-adapter 7.3.4
@ngtools/webpack 1.10.2
@schematics/angular 7.3.5
@schematics/update 0.13.5
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.6
Stackblitz uses Angular 6.1.9
馃悶 bug report
Affected Package
The issue is caused by package @angular/formsDescription
I have simple reactive form with some input fields.
The method
form.disable()is called to disable the form and all fields.The method works, as all input fields in the UI are now disabled.
Expected
The property
form.disabledshould betrueas the form is disabled now.Actual
The property
form.disabledisfalse.Cause of the problem
After building the form, I subscribe to control
f1and update the value of another control wheneverf1changes.Workaround
It works when I call
form.disable()twice.馃敩 Minimal Reproduction
https://stackblitz.com/edit/angular-issue-repro2-g8725l
馃實 Your Environment
Angular Version:
Stackblitz uses Angular 6.1.9