Screen reader announces 'value' prop instead of 'title' or 'aria-label' prop
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
调研方向
从 src/OptionList.tsx 第 213-215 行附近开始,这里 aria-live 通知当前使用活动节点的值。检查现有的 OptionList 测试,然后确保通知按 aria-label、字符串类型的 title,最后是 value 的顺序进行优先处理;验证相关测试套件覆盖每个 fallback。
由索引模型根据 Issue 内容生成。
描述
Problem:
The value prop of a tree node is often a numeric id, unique hash, or other non-human-readable identifier. Currently when navigating the Tree Select dropdown using a screen reader, each option's value prop is announced instead of either the title or aria-label prop. This makes it impossible for screen reader users to understand the options being presented.
Expected behavior:
I would suggest that the screen reader prioritize which prop to announce in the following order:
aria-label: If provided, this should be the primary prop announced by the screen reader. It is expected to contain the most accessible and human-readable description of the node.title: If thearia-labelprop is not provided, thetitleprop should be announced since this is the actual content displayed in the dropdown. However, as the 'title' prop can be either a string or a React element, the screen reader should only announce it if it is of type string.value: If neither anaria-labelprop nor a suitabletitleprop (of string type) is provided, thevalueprop should be announced.
Suspected Cause:
The span element within the dropdown in OptionList.tsx, which has aria-live="assertive" applied, seems to always announce the value of the active node, even when an aria-label is present. This should be modified to instead announce the human-readable props according to the order above.
https://github.com/react-component/tree-select/blob/master/src/OptionList.tsx#L213-L215
Related issues/PRs:
ant-design/ant-design#40055 - Existing Ant Design issue related to this problem.
ant-design/ant-design#41978 - Allows aria-label prop to be passed into rc-tree-select (released in antd@5.4.6)
react-component/tree-select#413 - This open PR proposes a labelInAriaLive boolean prop, which if true would announce the title prop instead of the value prop. Although this does not account for an aria-label prop being set on the node, which should be prioritized by the screenreader first.
react-component/tree-select#426 - This PR attempted to solve this issue but was closed without being merged.
- 主要语言
- TypeScript
- 星标
- 312
- 派生
- 204
- 平均合并
- 37 分钟
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-component/tree-select 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 52/100
react-component/tree-select#652 ·
-
难度 3/5 1-2 天 新手友好度 45/100
react-component/tree-select#528 ·
-
难度 2/5 1-3 小时 新手友好度 35/100
react-component/tree-select#485 ·
-
难度 4/5 3-5 天 新手友好度 28/100
react-component/tree-select#466 ·
-
DFS这里是否能调整为尾递归 未关闭
难度 3/5 1-2 天 新手友好度 35/100
react-component/tree-select#454 ·
查看 react-component/tree-select 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 90/100
TanStack/tanstack.com#1293 ·