components icon indicating copy to clipboard operation
components copied to clipboard

bug(MatMenu): Menu item with menuTrigger combine with menu item in sub component does not clos sub menu

Open mmercure opened this issue 3 years ago • 0 comments

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

image

A mat-menu, using a mat-menu-item with a matMenuTriggerFor next to a menu-item in a sub component does not properly closes sub menu and handle highlighted item on mouse over.

Reproduction

StackBlitz link: https://stackblitz.com/edit/x3u2hh?file=src%2Fexample%2Fmenu-nested-example.html Steps to reproduce:

  1. Open menu by clicking Animal index button
  2. Mouse Over Vertebrates menu, the sub menu opens
  3. Mouse Over Menu item component

Expected Behavior

The Vertebrates sub menu should close and Vertebrates menu should no longer be highlighted only menu-item Menu item component should be highlighted

Actual Behavior

The Vertebrates sub menu is still open and Vertebrates menu is still highlighted along with Menu item component

Environment

  • Angular: 16.1
  • CDK/Material: 16.2.9
  • Browser(s): chrome / Edge
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

mmercure avatar Oct 18 '23 19:10 mmercure