angular / angular/components

bug(mat-autocomplete): missing selection indicator (highlight + check icon) when using mat-autocomplete with mat-optgroup

未关闭
#29,189 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Accessibility area: material/autocomplete P4
主要语言
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

14

### Description

v15 introduced an indicator of the currently selected item:
![image](https://github.com/angular/components/assets/32791888/3f1e8ce5-5d32-4503-afdf-1c0d859f7360)
However, this indicator is missing when, instead of flat mat-options, we're using mat-optgroup with mat-options:
![image](https://github.com/angular/components/assets/32791888/0049610c-767c-4ffe-9b18-d0ad7446a56f)

### Reproduction

The repro is even in the official documentation of any version higher than v14:
https://v15.material.angular.io/components/autocomplete/examples

### Expected Behavior

We should see the indicator of a selected item even when we're using mat-optgroup

### Actual Behavior

Missing selection indicator when using mat-autocomplete with mat-optgroup

### Environment

- Angular: v15+
- CDK/Material: v15+

贡献指南

打开贡献指南

调研方向

从 issue 中链接的 autocomplete 示例开始,比较扁平 mat-options 情况和 mat-optgroup 情况。在 Angular/Material v15+ 上重现缺失的高亮和勾选图标,然后验证分组选项也会显示所选项目指示器。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。