Skip to content

bug(ngMenu): onSelect does not emit values #32435

@tsopeh

Description

@tsopeh

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 tried using Angular Aria's ngMenu based on the setup from the docs but it doesn't seem to work. The onSelect output doesn't emit the selected value.

On the other note, the docs are also not explicitly stating how to actually use any of the components - I had to read the tests and the source code to be sure what's expected (I know about the API button at the top of the docs page that lists the onSelect, but it's not obvious that this is intended way). It would be useful to see a showcase on how to use values from these components.

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-whsmfbqs?file=src%2Fmenu-test%2Fmenu-test.html
Steps to reproduce:

  1. The relevant implementation is in src/menu-test/menu-test.html & src/menu-test/menu-test.ts
  2. After the menu item is selected (click or enter key) it should be logged into console
  3. There's no log in the console. The onSelect didn't emit a value.

Expected Behavior

The onSelect should emit a value and the value should be a logged in the console.

Actual Behavior

The onSelect didn't emit a value. There's no log in the console.

Environment

  • Angular: latest ^21.0.1
  • CDK/Material Aria: ^21.0.1
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions