bug(cdk-menu): cdkMenuTriggerFor within cdkContextMenuTriggerFor causes repositioning when hovered
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 91
Mô tả
### 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
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với bản tái hiện Stackblitz được liên kết và so sánh nó với dev-app của kho lưu trữ components. Tái hiện việc định vị lại context menu bằng cách nhấp chuột phải vào Lucas ipsum và di chuột qua nút Open Context Menu; hoàn thành khi menu vẫn ở vị trí ban đầu khi di chuột qua trigger lồng nhau.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100