angular / angular/components

bug(matTooltip): Add option to set aria-labelledby rather than aria-describedby

Đang mở
#23,284 7 bình luận 11 reaction 0 người được giao Xem trên GitHub
Accessibility area: material/tooltip feature P4
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

#### Reproduction

matTooltip is only able to apply aria-describedby to its host element. This is not optimal for host elements that have no aria-label or text contents.

#### Expected Behavior

What behavior were you expecting to see?

For a button with no textual label, eg a MatIconButton, a tooltip typically provides a label rather than a description.
Having matTooltip apply aria-labeledby rather than would be better in these cases.

At the very least, it would be good to have an Input to configure matTooltip's labeledby vs describedby preference.
Extra credit: change the default for obvious cases like MatIconButton.

#### Actual Behavior

What behavior did you actually see?

matTooltip applies aria-describedby, with no option to change this behavior.

#### Environment

- Angular: 12
- CDK/Material: 12
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xác định phần triển khai matTooltip và hành vi trợ năng hiện có của nó. Kiểm tra cách aria-describedby được áp dụng cho các host, sau đó xác định cấu hình aria-labelledby được hỗ trợ và xác minh rằng việc gắn nhãn tooltip hoạt động với các nút không có nhãn mà không làm ảnh hưởng đến hành vi mô tả.

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

Đánh giá

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

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.