angular / angular/components

bug(CdkMenu): Using keyboard and mouse to open sub-menus will not close previous sub menus and will crash the browser

Ouverte
#28,862 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area: cdk/menu P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

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

Mixing keyboard navigation and mouse to open nested menus opens multiple nested menus (without closing previous ones) and eventually crashes the browser.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-vcre5b?file=src%2Fmain.ts
Steps to reproduce:
1. click the menu trigger button to open the first menu
2. hover with the mouse on the first menu item to open a sub-menu
3. press the down key (will highlight the 2nd menu item) and then "right" key to open the second sub-menu

To crash the browser:
4. hover the mouse on the first sub-menu that is open

### Expected Behavior

The first sub-menu will close once a 2nd one is opened.

### Actual Behavior

First sub-menu remains open when the 2nd one appears on top

### Environment

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et examinez le comportement de navigation au clavier et à la souris de CdkMenu décrit dans les étapes 1–4. Confirmez que l’ouverture du deuxième sous-menu ferme le premier et que le survol du sous-menu ouvert ne fait plus planter Chrome ou Edge ; le rapport ne mentionne aucun fichier ni test du dépôt.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.