patternfly / patternfly/patternfly-react

Bug - Table - hoverable example invalid markup and selection not announced on navigation

未关闭
#7,745 5 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

A11y Stale
主要语言
TypeScript
星标
862
派生
392
平均合并
4 天 8 小时
30 天内合并 PR
9

描述

Describe the problem
Followup to #7732

The hoverable selectable Table example throws the following warning in the dev environment:

Warning: validateDOMNesting(...): <output> cannot appear as a child of <tbody>

Additionally, due to the way screen readers navigate tables (by cell rather than by row), the row that is selected only gets announced when a row is selected via a cell. Using Tab to navigate between rows (as the table caption instructs) does announce whether the row is selected, but it only announces the aria-label and not the content of the row.

Some possible alternatives:

  • Add a hidden input to each row, similar to the implementation seen in Data list selectable rows example. To avoid invalid markup, I believe this might require having an empty column similar to the table examples that use visible radio inputs.
  • Add a hidden input to the first cell of a row, and add styling so that when the radio input has focus it looks like the row has focus.
  • Move the current output element to the first <td> element of a row

How do you reproduce the problem?
Navigate the Hoverable selectable table example with a screen reader

Expected behavior
Markup is valid, and users can be notified whether the current row is selected as best as possible

Is this issue blocking you?
No

Screenshots
N/A

What is your environment?
N/A

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

Any other information?
N/A

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 issue 中链接的可悬停、可选择的 Table 示例开始,并在使用屏幕阅读器导航时重现警告和屏幕阅读器行为。检查示例的行选择标记;完成的标准是表格具有有效标记,并宣布当前行是否已选中以及其内容(尽可能完整)。

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

评估

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

把新 issue 发到你的邮箱

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