Skip to content

bug(aria/menu): Callback onSelect in menu is not called #32615

@esb-dev

Description

@esb-dev

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I try to get the selected menuitem:
In app.html:

<div ngMenu class="menu" #formatMenu="ngMenu" (onSelect)="onSelect($event)">

In app.ts:

  onSelect(value: string) {
    console.log(value);
    alert('value');
  }

but the function onSelect is not called.

Reproduction

StackBlitz link: https://stackblitz.com/~/github.com/esb-dev/menu
Steps to reproduce:

  1. Just run the app
  2. Click on one of the menuitems
  3. No log in console nor the alert appears

Expected Behavior

log in console of there value of the menu item and an alert with the same message

Actual Behavior

callback is not called

Environment

Angular CLI : 21.0.4
Angular : 21.0.6
Node.js : 25.2.1 (Unsupported)
Package Manager : npm 11.6.2
Operating System : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/aria │ 21.0.5 │ ^21.0.5 │
│ @angular/build │ 21.0.4 │ ^21.0.4 │
│ @angular/cli │ 21.0.4 │ ^21.0.4 │
│ @angular/common │ 21.0.6 │ ^21.0.0 │
│ @angular/compiler │ 21.0.6 │ ^21.0.0 │
│ @angular/compiler-cli │ 21.0.6 │ ^21.0.0 │
│ @angular/core │ 21.0.6 │ ^21.0.0 │
│ @angular/forms │ 21.0.6 │ ^21.0.0 │
│ @angular/platform-browser │ 21.0.6 │ ^21.0.0 │
│ @angular/router │ 21.0.6 │ ^21.0.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
│ vitest │ 4.0.16 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions