angular / angular/components

feat(menu): Add delay before closing nested menu after mouse leave

Đang mở
#24,476 5 bình luận 10 reaction 0 người được giao Xem trên GitHub
area: material/menu feature P5
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

**Problem**

When navigating through nested menu items, we must follow a tight path, otherwise it'll close the nested menu.

**Proposed Solution**

In the current behavior, after the mouse leave, the menu is closed.
If we add some delay, before closing the nested menu after the mouse leave event, we could leverage from better navigation.

**Sugestion**

Add an option (matMenuNestedCloseDelay) to change the behavior of closing the nested menu.
When this option is used, it should wait X miliseconds (similar to matTooltipShowDelay) before closing the nested menu after mouse leave.

Also add this option to [MatMenuDefaultOptions](https://material.angular.io/components/menu/api#MatMenuDefaultOptions) to allow override this behavior with injection token.

```

...

```

### Use Case

If I try to selected the 90 days options, througth the smallest path, it closes the nested menu.

![Animation](https://user-images.githubusercontent.com/12090931/155517615-63074bfb-b909-4a7a-afe8-7a15dfa57a05.gif)

**Desired Behavior**

Taken from [stackoverflow](https://stackoverflow.com/a/50953452) with similar issue.
![Animation2](https://user-images.githubusercontent.com/12090931/155519988-513f1cd9-803d-493f-993b-b10b1af9b93c.gif)

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 lần theo hành vi đóng của các mat-menu lồng nhau khi chuột rời khỏi chúng và so sánh độ trễ được yêu cầu với matTooltipShowDelay. Xác định cách matMenuNestedCloseDelay được cung cấp trên mat-menu và MatMenuDefaultOptions, sau đó xác minh hành vi đóng trễ và việc ghi đè injection-token bằng các bài kiểm thử hiện có của menu.

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ó
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.