angular / angular/components

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

Abierto
#24,476 5 comentarios 10 reacciones 0 asignados Ver en GitHub
area: material/menu feature P5
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza por rastrear el comportamiento de cierre de los mat-menu anidados al salir el ratón y compáralo con el retraso solicitado para matTooltipShowDelay. Define cómo debe exponerse matMenuNestedCloseDelay en mat-menu y MatMenuDefaultOptions, y verifica después el comportamiento de cierre retardado y la sobrescritura del injection-token con las pruebas existentes del menú.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.