MenuToggle does not derive accessible name from visible text children
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
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- react, typescript
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
Bắt đầu từ component MenuToggle và kiểm tra cách tên truy cập của nó được tính khi nhận các phần tử con là văn bản hiển thị mà không có aria-label. So sánh hành vi này với một nút tiêu chuẩn và xác định các nhãn tường minh nên hoạt động như thế nào đối với các toggle chỉ có biểu tượng. Hoàn tất khi các phần tử con là văn bản cung cấp tên truy cập theo mặc định, trong khi các giá trị aria-label tường minh vẫn có thể được sử dụng cho các toggle chỉ có biểu tượng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When MenuToggle renders with visible text children (e.g., <MenuToggle>Actions</MenuToggle>), it does not automatically derive its accessible name from that text. Consumers must manually duplicate the text in an aria-label prop, which is error-prone and violates WCAG 2.5.3 (Label in Name).
WCAG Impact
- 2.5.3 Label in Name — For UI components with visible text labels, the accessible name must contain the visible text. If
MenuToggledoesn't derive its accessible name from its children, speech-input users who say "click Actions" may not activate the correct control.
Steps to Reproduce
- Render
<MenuToggle>Actions</MenuToggle>without anaria-label - Inspect the element's computed accessible name in browser DevTools or a screen reader
- The accessible name may not match the visible "Actions" text
Expected Behavior
MenuToggle should derive its accessible name from its text children by default, similar to how a standard <button>Actions</button> does. An explicit aria-label should only be needed for icon-only toggles (kebab menus).
Current Behavior
Consumers must manually provide aria-label="Actions" even when the text "Actions" is already visible in the toggle. Our codebase (ansible/ansible-ui) has hardcoded fallback aria-label values like 'kebab dropdown toggle' and 'dropdown toggle' that don't match the visible text, precisely because the component doesn't handle this automatically.
Jira Issue: PF-4545
- 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của patternfly/patternfly-react
-
PF Team
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
patternfly/patternfly-react#12651 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
patternfly/patternfly-react#12637 ·
-
PF Team
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
patternfly/patternfly-react#12617 · 1 bình luận ·
-
PF Team
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
patternfly/patternfly-react#12610 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
patternfly/patternfly-react#12600 ·
Tất cả issue của patternfly/patternfly-react
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
-
code-quality refactoring
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/deepagents#6450 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
vercel/react-tweet#225 ·