angular / angular/components

bug(CdkMenuItem): Main menu closes after clicking on a menu item that is a menu

Đang mở
#30,050 4 bình luận 2 reaction 0 người được giao Xem trên GitHub
area: cdk/menu P3
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

Clicking on a menu item that is also a menu will close the whole menu, instead of closing only the opened submenu.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/4aortd
Steps to reproduce:
1. Click on `File` button
2. Click on `New` menu item

### Expected Behavior

The submenu for the `New` menu item is closed (or kept open), the menu associated with `File` is kept open (like a `CdkMenuBar` or the menu nested example: https://material.angular.io/components/menu/examples#menu-nested)

### Actual Behavior

The submenu for the `New` menu item is closed and the `File` menu is closed as well.

### Environment

- Angular: 19.0.0
- CDK/Material: 19.0.0
- Browser(s): 131.0.6778.70 (Official Build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 Pro

Hướng dẫn đóng góp

Mở 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à thực hiện tương tác File > New được mô tả trong issue. Theo dõi hành vi đóng của mục menu và menu con trong phần triển khai menu của Angular CDK, sau đó xác minh rằng việc đóng New vẫn để File mở, sử dụng các ví dụ nested-menu và CdkMenuBar làm tham chiếu về hành vi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, 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
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.