Skip to content

bug(aria/menu): MenuItem disabled doesn't accept a bare attribute #33964

Open

Description

@DuncanFaulkner

Is this a regression? No

Description

ngMenuItem's disabled input has no booleanAttribute transform, so a bare disabled attribute fails strict template type-checking:

<div ngMenuItem value="archive" disabled>Archive</div>
error TS2322: Type 'string' is not assignable to type 'boolean'.

Every other disabled input in @angular/aria accepts the bare attribute: Toolbar, ToolbarWidget, ToolbarWidgetGroup, Listbox, Option, Combobox, AccordionGroup and AccordionTrigger all use input(false, {transform: booleanAttribute}). MenuItem declares input<boolean>(false).

It also matters for wrappers. A component that applies MenuItem as a host directive and exposes disabled through hostDirectives inputs can't add the transform itself, so its users can't write <my-menu-item disabled> either.

Reproduction

  1. Use ngMenu with <div ngMenuItem value="x" disabled>X</div> in a strict-templates app.
  2. Build. Type-checking fails with TS2322.

Without strict templates (or in JIT), the value is '', which is falsy, so the item is not disabled.

Expected behaviour

A bare disabled disables the item, the same as [disabled]="true" and the same as the other @angular/aria directives.

Actual behaviour

A compile error with strict templates. Otherwise the item is not disabled.

Environment

  • @angular/aria 22.2.3 (also 22.3.0-next.2)
  • Angular 22.2

Activity

  1. added a commit that references this issue on Oct 16, 2026
    63433c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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