carbon-components-angular icon indicating copy to clipboard operation
carbon-components-angular copied to clipboard

Combobox not getting disabled using form control name

Open anushamuthyalampally opened this issue 3 years ago • 2 comments

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.

anushamuthyalampally avatar Dec 10 '21 09:12 anushamuthyalampally

I guess you should replace the first line

<div [formGroup]="sampleForm">

by

<form [formGroup]="sampleForm">

?

grenobnik avatar May 05 '22 09:05 grenobnik

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

anemonetea avatar Jan 14 '23 08:01 anemonetea