angular / angular/components

bug(menu): Right click closes CDK Menu but not Component Menu

オープン
#27,913 コメント 2 件 リアクション 2 件 担当者 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

When a mat-menu is opened and the user right clicks anywhere outside the mat-menu it does not close. Whereas for the cdkMenu when you right click outside the menu it close it. Is this the expected behaviour?

And is there any way to make the cdkMenu behave the same as mat-menu?

This makes inspecting the cdkMenu/cdkMenuItem etc. very hard as the menu disappears in the dom before I can open the console and inspect it.

### Reproduction

StackBlitz link: https://stackblitz.com/run?file=src%2Fapp%2Fcdk-menu-standalone-menu-example.ts
Steps to reproduce:
1. Open the cdkMenu
2. Right click outside the menu
3. The menu closes

StackBlitz link: https://stackblitz.com/run?file=src%2Fapp%2Fmenu-icons-example.ts
Steps to reproduce:
1. Open the mat-menu
2. Right click outside the menu
3. The menu stays open

### Expected Behavior

I expect the cdkMenu and mat-menu to behave the same

### Actual Behavior

cdkMenu and mat-menu do not behave the same when right clicking outside the menu.

### Environment

- Angular: 16
- CDK/Material: 16
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

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

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

調査の方向性

2 つの再現エントリポイント src/app/cdk-menu-standalone-menu-example.ts と src/app/menu-icons-example.ts から始め、外側を右クリックしたときの CDK menu と mat-menu の動作を比較します。各メニューの外側クリックの処理を追跡し、どの動作を一致させるべきかを判断します。Chrome で確認した際に両方の例が一貫して動作すれば完了です。

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

評価

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

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

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