Skip to content

bug(cdk/menu): menu is closed on mousedown event #27878

Open

Description

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

14

Description

When menu is opened, using standalone trigger, it is closed by clicking outside the menu on mousedown event.

Reproduction

  1. Go to the CDK menu examples page: https://material.angular.io/cdk/menu/examples.
  2. Open the menu using "Click me!" button under "Menu with Standalone Trigger".
  3. Click outside the menu.

Expected Behavior

Menu should be closed using mouseup event to comply with WCAG Level A - 2.5.2 criterion (https://www.w3.org/TR/WCAG21/#pointer-cancellation)

Actual Behavior

Menu is closed with mousedown event.
The same bahavior appears in CDK v15 - https://v15.material.angular.io/cdk/menu/examples
But not in v14 - https://v14.material.angular.io/cdk/menu/examples

Also latest Material Menu component works as expected - https://material.angular.io/components/menu/examples

Environment

  • Angular: 15, 16
  • CDK/Material: 15, 16
  • Browser(s): latest Chrome, Firefox, Safari
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS (14.0 and 13.6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/menu

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions