Skip to content

cds-menu-item type checkbox toggles despite being disabled #3184

@theRobert174

Description

@theRobert174

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

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions