bug(cdk/menu): sub menu with disabled items only is not closed when other sub menu is opened
- 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
This issue only occurs when using the menu with a keyboard.
If in a cdk menu, a sub menu is opened with ONLY disabled children, and then another sub menu is opened, that sub menu with the disabled children remains open.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-stnsdh?file=src%2Fapp%2Fexample-component.html
Steps to reproduce:
1. focus "Open Menu" button
2. press space / open menu
3. navigate to menu item "With disabled child" using arrow keys
4. open sub menu by pressing arrow right
5. navigate to "With enabled child" by pressing arrow up
6. open sub menu by pressing arrow right
### Expected Behavior
Sub menu with disabled child is closed
### Actual Behavior
Sub menu with disabled child is NOT closed
### Environment
- Angular: 15
- CDK/Material: 15
- Browser(s): Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la reproduction StackBlitz liée et suivez le comportement de navigation au clavier du menu Angular CDK pour les sous-menus contenant uniquement des éléments enfants désactivés. Vérifiez la séquence dans Firefox sur Ubuntu, puis confirmez que l’ouverture du deuxième sous-menu ferme le premier tout en préservant le comportement attendu du clavier.
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é
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 50/100