bug(cdk/menu): sub menu with disabled items only is not closed when other sub menu is opened
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 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 中验证这一序列,然后确认打开第二个子菜单会关闭第一个子菜单,同时保留预期的键盘行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, typescript
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 50/100