angular / angular/components

bug(cdk-menu): cdkMenuTriggerFor within cdkContextMenuTriggerFor causes repositioning when hovered

オープン
#26,675 コメント 0 件 リアクション 6 件 担当者 0 名 GitHub で見る
area: cdk/menu P3
主要言語
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

Using a `[cdkMenuTriggerFor]` within a container that has a `[cdkContextMenuTriggerFor]` for the same cdkMenu.

Current behavior:
When a cdkMenu is opened by the `[cdkContextMenuTriggerFor]` the cdkMenu it will be repositioned to the `[cdkMenuTriggerFor]` when the `[cdkMenuTriggerFor]` is hovered.

Expected behavior:
the cdkMenu should stay at its current location, even if `[cdkMenuTriggerFor]` is hovered.

In case this is confirmed as a bug, I could provide a PR fixing the issue

### Reproduction

Stackblitz: https://stackblitz.com/edit/components-issue-uo4741?file=src/app/example-component.html

Steps to reproduce:
1. Right click on Lucas ipsum
2. hover Open Context Menu button

### Expected Behavior

contextMenu does not change position

### Actual Behavior

contextMenu moves to the location of the button trigger

### Environment

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

Can also be reproduced with the dev-app in the components repo

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

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

調査の方向性

リンクされている Stackblitz の再現から始め、コンポーネントリポジトリの dev-app と比較します。Lucas ipsum を右クリックし、Open Context Menu ボタンにホバーしてコンテキストメニューの再配置を再現します。ネストされたトリガーにホバーしたときにメニューが元の位置に留まれば完了です。

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

評価

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

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

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