angular / angular/components

bug(CdkMenu): Using keyboard and mouse to open sub-menus will not close previous sub menus and will crash the browser

Đang mở
#28,862 3 bình luận 1 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

Mixing keyboard navigation and mouse to open nested menus opens multiple nested menus (without closing previous ones) and eventually crashes the browser.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-vcre5b?file=src%2Fmain.ts
Steps to reproduce:
1. click the menu trigger button to open the first menu
2. hover with the mouse on the first menu item to open a sub-menu
3. press the down key (will highlight the 2nd menu item) and then "right" key to open the second sub-menu

To crash the browser:
4. hover the mouse on the first sub-menu that is open

### Expected Behavior

The first sub-menu will close once a 2nd one is opened.

### Actual Behavior

First sub-menu remains open when the 2nd one appears on top

### Environment

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

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à kiểm tra hành vi điều hướng bằng bàn phím và chuột của CdkMenu được mô tả trong các bước 1–4. Xác nhận rằng việc mở menu con thứ hai sẽ đóng menu con thứ nhất, và việc di chuột qua menu con đang mở không còn làm Chrome hoặc Edge bị crash; báo cáo không nêu tệp hoặc test nào trong repository.

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ó
4/5
Thời gian dự kiến
3-5 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.