feat(CdkMenu/CdkContextMenuTriggerFor): Allow CdkMenu to be programmatically opened/closed
- 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ả
## Feature Description
### Current Behaviour
The directive `CdkMenu` is used with combination of `CdkContextMenuTriggerFor`. When user right-clicks (context-menu event), the menu gets opened and clicking on outside of the menu will close the menu.
### New Feature Requested
It would be great if user can manually/programmatically open/close the menu. And also disable closing the menu clicking outside.
#### Possible Solutions
1. Add a boolean input property `cdkContextMenuDisableCloseOnOutsideClick` - This will disable closing the `CdkMenu` on outside click
2. Add an event emitter property `cdkContextMenuTriggered` - This will emit everytime user right-clicks (context-menu event) with the coordinates
3. Add an event emitter property `cdkContextMenuClickedOutside` - This will emit everytime user clicks outside of the `CdkMenu`
### Use Case
This will allow users to handle animations with `CdkMenu` if they want to apply on open/close.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc các điểm vào của directive CdkMenu và CdkContextMenuTriggerFor, đồng thời truy vết hành vi hiện có khi mở context-menu và đóng khi click bên ngoài. Làm rõ API công khai và ngữ nghĩa sự kiện cho việc mở/đóng theo chương trình, vô hiệu hóa việc đóng khi click bên ngoài, cũng như các thông báo về context-menu/click bên ngoài. Được xem là hoàn thành khi hành vi đã thống nhất được triển khai và được các bài kiểm thử menu liên quan bao phủ.
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
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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