angular / angular/components

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

オープン
#24,476 コメント 5 件 リアクション 10 件 担当者 0 名 GitHub で見る
area: material/menu feature P5
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、ネストされた mat-menu でマウスが離れたときに閉じる挙動を追跡し、要求された遅延を matTooltipShowDelay と比較します。matMenuNestedCloseDelay を mat-menu と MatMenuDefaultOptions でどのように公開するかを定義し、メニューの既存のテストで遅延クローズの挙動と injection-token のオーバーライドを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。