patternfly / patternfly/patternfly-react

Bug - MenuToggle - aria labelling doesn't work as intended

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

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

A11y PF Team Stale
Ngôn ngữ chính
TypeScript
Star
862
Fork
392
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
9

Mô tả

Describe the problem
Per https://github.com/patternfly/patternfly/issues/6562, we need to update how aria labeling is handled in MenuToggle, namely:

  • Right now the aria-label on the MenuToggle does nothing since the text content is taking precedence,

  • We need to ensure MenuToggle's with dynamic text content have an accessible name that includes a static label as well as the dynamic toggle content

How do you reproduce the problem?
Go to a MenuToggle and Select example and navigate both with VoiceOver. Notice that only the text content gets announced. Then choose a new option in the Select example, and notice that there's no context for what the Select is actually for but rather just the current text content.

Expected behavior
Note this is most likely only for a non-typeahead and non-plain MenuToggle, basically only a MenuToggle whose content would be dynamic like in Select examples (where by default the toggle content may be "Choose an option", then choosing an option updates the toggle content to e.g. "Option 1").

  • MenuToggle should have an aria-labelledby on its internal button element that should reference the pf-v6-c-menu-toggle__button (if aria-label is passed; if aria-labelledby is passed to MenuToggle then this internal aria-labelledby should reference that ID instead) and pf-v6-c-menu-toggle__text elements -- this should only occur when aria-label or aria-labelledby are passed to MenuToggle

  • We should add aria-labelledby to the props interface to explicitly expose it

  • Examples using MenuToggle must be updated so that there is a unique/descriptive static label as well as its content label

Using the single select example in React, here's what the markup should end up looking similar to:

image

Is this issue blocking you?
List the workaround if there is one.

Screenshots
If applicable, add screenshots to help explain the issue.

What is your environment?

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

What is your product and what release date are you targeting?

Any other information?


Jira Issue: PF-1729

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

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

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.

Hướng nghiên cứu

Tìm phần triển khai MenuToggle, giao diện props của nó và các ví dụ React Select được liên kết trong issue. Kiểm tra cách aria-label, aria-labelledby và văn bản toggle động hiện được render, sau đó cập nhật component và các ví dụ để button bên trong có accessible name bắt buộc. Xác minh markup kết quả bằng ví dụ single-select và VoiceOver.

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

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
accessibility, frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
65/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.