angular / angular/components

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

オープン
#27,403 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: cdk/menu P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた StackBlitz の再現手順から始め、無効化された子要素のみを含むサブメニューに対する Angular CDK メニューのキーボードナビゲーション動作を追跡します。Ubuntu 上の Firefox でこのシーケンスを検証し、2 番目のサブメニューを開くと 1 番目のサブメニューが閉じ、期待されるキーボード動作が維持されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
50/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。