bug(material/select): mat-select option is not announced on the very first time options are visible

Đang mở
#34,057 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
67/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
angular, typescript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

Start by reading the Angular Material mat-select implementation and its accessibility tests for announcing the active option when the panel opens. Reproduce the issue with the linked reactive-form example and a screen reader, then trace how the initially selected option is announced on open versus after navigating away and back. Done means the selected state is announced on the first open; add or update a regression test for that behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Accessibility area: material/select P3
  1. 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 a mat-select has an initial value (for example, set through a reactive form control) and the user opens it for the first time, the screen reader reads the active option's text but does not announce it as "selected". If the user moves to different options and returns back to the selected one, the same option is announced correctly as "selected".

Reproduction

StackBlitz link: https://stackblitz.com/edit/3j8yhubg?file=src%2Fexample%2Fselect-reactive-form-example.ts
Steps to reproduce:

  1. Create a mat-select bound to a reactive FormControl with an initial value:
Image
  1. Turn on a screen reader (VoiceOver).
  2. Tab to the select and open it with Space, Enter or Alt+Down
  3. Listen to the announcement for the highlighted option.
  4. Go to next option.
  5. Return to previous option and listen to the announcement. "Selected" is announced for the option which is selected.
Expected Behavior

"Selected" should be announced on the very first time the panel of options open.

Actual Behavior

"Selected" is not announce on the very first time the panel opens and the user is on the selected item. It is announced when the user goes to some different options and returns to the selected item.

Environment
  • Angular: 21.2.22
  • CDK/Material: 21.2.14
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): MacOS
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.9k
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
83

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/components

Tất cả issue của angular/components

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.