- Notifications
You must be signed in to change notification settings - Fork 317
Closed
Labels
HacktoberfestThe smell of pumpkin and hacking is in the air!The smell of pumpkin and hacking is in the air!released on @latest
Description
I've encountered unexpected behavior with the cds-menu-item
component in my Angular application.
What i wanted to do is disable some options but still show the checkmark indicating that they are active.
When the item is marked as disabled, it still responds to user interactions—specifically:
- The
(checkedChange)
event is triggered. - The checkmark icon toggles visually.
However, the (itemClick)
event does not emit anything as expected.
The internal logic still allows state changes and visual feedback, which can be confusing for a disabled item.
Configuration used to reproduce the issue:
Versions:
- Angular 18.2.14
- Carbon-components-angular 5.61.1
<cds-menu-button size="sm" kind="ghost" label="Widgets" menuAlignment="bottom-end"> @for (widgetOpt of catalogOfWidgets(); track widgetOpt) { <cds-menu-item [label]="widgetOpt.label | translate" type="checkbox" [checked]="widgetOpt.checked" [disabled]="widgetOpt.checked" (checkedChange)="printer({event: $event, disabledInput: widgetOpt.checked})" (itemClick)="mountWidget(widgetOpt.value)"></cds-menu-item> } </cds-menu-button>
cds-menu-button.issue.mp4
Metadata
Metadata
Assignees
Labels
HacktoberfestThe smell of pumpkin and hacking is in the air!The smell of pumpkin and hacking is in the air!released on @latest