angular / angular/components

bug(cdk/menu): sub menu with disabled items only is not closed when other sub menu is opened

Aperta
#27,403 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: cdk/menu P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata e traccia il comportamento della navigazione da tastiera del menu Angular CDK per i sottomenu che contengono solo elementi figli disabilitati. Verifica la sequenza in Firefox su Ubuntu, quindi conferma che l'apertura del secondo sottomenu chiuda il primo mantenendo il comportamento previsto della tastiera.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
50/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.