You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(aria/menu): MenuItem disabled doesn't accept a bare attribute #33964
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
Use ngMenu with <div ngMenuItem value="x" disabled>X</div> in a strict-templates app.
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.
Activity
fix(aria/menu): accept a bare disabled attribute on MenuItem