angular / angular/components

bug(MatSelect): With VoiceOver + Chrome, VoiceOver's focus ring snaps from mat-options to mat-select element

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

When navigating through the options in a mat-select dropdown panel using Voiceover, if the currently selected option is active, the focus snaps back to the mat-select element. It returns to focusing on the active mat-option once you've used arrows to navigate one or two items away from the active option.

e.g. On a fruit selector, I've previously selected 'Apple'. Then I re-open the dropdown while using Voiceover and begin navigating through the options. When I reach 'Apple' in the list, suddenly the focus snaps back to the mat-select element rather than the active mat-option in the dropdown list.

### Reproduction

Steps to reproduce:

1. Access https://material.angular.io/components/select/overview
2. Navigate to Basic mat-select with tab
3. Use arrow keys to go through mat-options and select one (e.g. pizza)
4. Open mat-select again and go back through mat-options with arrow keys
5. When the previously selected mat-option (pizza) is active, observe focus ring snaps back to mat-select element
![image](https://user-images.githubusercontent.com/24943424/161581952-82f8aca8-cd0f-4c09-b1fb-fa0fa7e1d212.png)
6. Continue to go through options and focus ring eventually snaps back to the active option
![image](https://user-images.githubusercontent.com/24943424/161581850-80cd3326-9db1-4cc6-b366-adeb281321b4.png)

### Expected Behavior

When I navigate to the currently selected item in the dropdown list, the focus ring should remain on the active mat-option

### Actual Behavior

When I navigate to the currently selected item in the dropdown list, the focus ring snaps back to the mat-select element.

### Environment

Angular: v11, v12, v13 (observed from the latest 3 versions on the official website)
CDK/Material: Material
Browser(s): Chrome
Operating System (e.g. Windows, macOS, Ubuntu): macOS

贡献指南

打开贡献指南

调研方向

首先,使用之前已选择的选项,按照列出的步骤,在 Material select 概览 URL 重现 VoiceOver 和 Chrome 的行为。跟踪 mat-select 和 mat-option 的焦点行为,然后验证导航到所选项目时焦点环仍保留在该 mat-option 上,并且现有的导航流程仍能正常工作。

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

评估

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

把新 issue 发到你的邮箱

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