You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I set disabled via FormGroup Controls, checkbox does not get disabled (missing setDisabledState)
When I manually set disabled via checkbox itself, i will get the following warning:
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid 'changed after checked' errors.
Example:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
Expected behavior:
Setting disabled in the FormGroup Controls, checkbox should be rendered disabled.
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
When I set disabled via FormGroup Controls, checkbox does not get disabled (missing setDisabledState)
When I manually set disabled via checkbox itself, i will get the following warning:
Expected behavior:
Setting disabled in the FormGroup Controls, checkbox should be rendered disabled.
Steps to reproduce:
See code snippet below:
component.ts
this.form = formbuilder.group({"myCheckbox": [{value: true, disabled:true}]});
component.html
Related code:
Add in setDisabledState into checkbox.component.ts as follow to fix this issue.
The text was updated successfully, but these errors were encountered: