angular / angular/components

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

オープン
#27,962 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: material/menu P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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](https://github.com/angular/components/assets/6987117/f79c0a39-5f3e-4ccc-b888-30b3d3a8038a)

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた StackBlitz の再現例、特に src/example/menu-nested-example.html から始め、ネストされた mat-menu の hover シーケンスを再現します。menu-item と matMenuTriggerFor のインタラクションを追跡し、親がハイライトされたまま開いている理由を特定します。Vertebrates サブメニューが閉じ、Menu item component のみがハイライトされた状態になれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。