Chip: on the web every Chip sets aria-selected on role button
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react-native, typescript
调研方向
从Chip.tsx开始,issue指出这里传入了aria-selected,且selected默认为false;修改之前,先比较Web和原生端的行为。检查/chip处的Chip示例,并在Web应用上运行axe-core,以确认违规问题已消失,且选中的toggle会公开其状态。当普通操作型chip省略toggle状态,且选中的Web chip使用受支持的按钮状态时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Current behaviour
On the web, every Chip renders <button role="button" aria-selected="true|false"> (Chip.tsx passes aria-selected={selected}, and selected defaults to false). aria-selected is not allowed on role button, so screen readers ignore the selected state, and axe-core reports aria-allowed-attr (critical): "ARIA attribute is not allowed: aria-selected". The example app shows it on the Chip, Card, Floating Action Button, List.Section and Tooltip screens.
Expected behaviour
On the web a Chip used as a toggle exposes its state with aria-pressed, the state role button supports, and only when the app passes selected, so a plain action chip isn't announced as a toggle. Native keeps announcing the selected state as it does today. axe reports no aria-allowed-attr violation.
How to reproduce?
- Run the example app on the web from
main(yarn install, thennpx expo start --webinexample/). - Open the Chip example (
/chip). - Run axe-core on the page (for example with the axe DevTools extension).
Preview
What have you tried so far?
Your Environment
| software | version |
|---|---|
| react-native-paper | main (8cb344b) |
| browser | Chromium 153 |
- 主要语言
- TypeScript
- 星标
- 14.5k
- 派生
- 2.3k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/react-native-paper 的其他 Issue
-
feature request
难度 2/5 1-3 小时 新手友好度 72/100
callstack/react-native-paper#5189 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
callstack/react-native-paper#5187 ·
维护者通常 1 天内回复
-
Accessibility example app good first task
难度 1/5 1-3 小时 新手友好度 86/100
callstack/react-native-paper#5182 ·
维护者通常 1 天内回复
-
Chip: accessibilityState passed by caller is discarded; aria-checked is never forwarded to the real rendered node可能已有人在做 @bhumikabiyani 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
callstack/react-native-paper#5146 · 2 条评论 ·
维护者通常 1 天内回复
-
Tooltip: onPress event object is not propagated to parent component on native可能已有人在做 @aliyilmaztech 于 87 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 74/100
callstack/react-native-paper#5003 ·
维护者通常 1 天内回复
查看 callstack/react-native-paper 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
pending close triaging
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#62582 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
live-codes/livecodes#1079 · 1 条评论 ·
维护者通常 1 天内回复
-
Add: ESP 2 RO未关闭approved check:passed streams:add
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复