angular / angular/components

bug(menu): Right click closes CDK Menu but not Component Menu

Abierto
#27,913 2 comentarios 2 reacciones 0 asignados Ver en GitHub
area: material/menu P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### Is this a regression?

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

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

_No response_

### Description

When a mat-menu is opened and the user right clicks anywhere outside the mat-menu it does not close. Whereas for the cdkMenu when you right click outside the menu it close it. Is this the expected behaviour?

And is there any way to make the cdkMenu behave the same as mat-menu?

This makes inspecting the cdkMenu/cdkMenuItem etc. very hard as the menu disappears in the dom before I can open the console and inspect it.

### Reproduction

StackBlitz link: https://stackblitz.com/run?file=src%2Fapp%2Fcdk-menu-standalone-menu-example.ts
Steps to reproduce:
1. Open the cdkMenu
2. Right click outside the menu
3. The menu closes

StackBlitz link: https://stackblitz.com/run?file=src%2Fapp%2Fmenu-icons-example.ts
Steps to reproduce:
1. Open the mat-menu
2. Right click outside the menu
3. The menu stays open

### Expected Behavior

I expect the cdkMenu and mat-menu to behave the same

### Actual Behavior

cdkMenu and mat-menu do not behave the same when right clicking outside the menu.

### Environment

- Angular: 16
- CDK/Material: 16
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con los dos puntos de entrada de reproducción, src/app/cdk-menu-standalone-menu-example.ts y src/app/menu-icons-example.ts, y compara el comportamiento de CDK menu y mat-menu al hacer clic derecho fuera. Sigue el tratamiento de los clics fuera de cada menú y determina qué comportamiento debería alinearse. Se considera terminado cuando ambos ejemplos se comportan de forma coherente al inspeccionarlos en Chrome.

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
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.