carbon-components-angular
carbon-components-angular copied to clipboard
Combobox not getting disabled using form control name
I am unable to disable combobox using form control name
Below is how I am using combobox
<div [formGroup]="sampleForm">
<ibm-combo-box
id="dtype_list"
[items]="idtyps"
itemValueKey="id"
formControlName="idtype"
(selected)="onChange($event)">
<ibm-dropdown-list></ibm-dropdown-list>
</ibm-combo-box>
</div>
In component:
this.sampleForm = fb.group(
idtype: [{value: '', disabled: true}],
});
onChange(event){
this.sampleForm.controls.idtype.disable({emitEvent: true});
}
combobox doesn't get disabled when I try to disable it using form control name in the above way.
I guess you should replace the first line
<div [formGroup]="sampleForm">
by
<form [formGroup]="sampleForm">
?
This might be related to the visual indication of the disabled state not working: https://github.com/carbon-design-system/carbon-components-angular/issues/1409 PR: https://github.com/carbon-design-system/carbon-components-angular/pull/2413