angular / angular/components

bug(MENU): Types of property 'hasBackdrop' are incompatible

Đang mở
#24,078 2 bình luận 6 reaction 0 người được giao Xem trên GitHub
area: material/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?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

Definitely worked in 12.2.9, didn't check with later versions

### Description

On version 13.1.0 with `exactOptionalPropertyTypes` flag,
when trying to use the Menu component, following error shows up in Terminal:
![image](https://user-images.githubusercontent.com/52247963/145472621-6cae98b6-0f33-48bf-980b-34b2ad9bf698.png)

### Reproduction

StackBlitz Example project doesn't build on latest version, so I couldn't reproduce it for you. You can see it working on v12: https://stackblitz.com/edit/components-issue-fau7sh?file=src%2Fapp%2Fexample-component.html.

To check locally, create a new Angular 13 project, install the material library and enable the `exactOptionalPropertyTypes` flag in `tsconfig.json`

### Expected Behavior

Code compiles and Menu works.

### Actual Behavior

Code doesn't compile, Menu doesn't work.

### Environment

- Angular: 13.1.0
- CDK/Material: 13.1.0
- Browser(s): Chrome 96
- Operating System: Windows 11

If you guys have any questions, let me know

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

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tạo dự án Angular 13 được mô tả trong issue, bật exactOptionalPropertyTypes trong tsconfig.json và sử dụng component Menu. So sánh lỗi kiểu với phiên bản 12.2.9 và kiểm tra các định nghĩa kiểu liên quan đến Menu có liên quan. Hoàn thành khi dự án biên dịch được và Menu hoạt động khi flag được bật.

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.