Chip: accessibilityState passed by caller is discarded; aria-checked is never forwarded to the real rendered node
维护者通常 17 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react-native, typescript
调研方向
先阅读 Chip 的实现,并追踪 props 如何传递到 TouchableRipple 及其 Pressable 节点;issue 指出,aria-checked 在外层 Surface 的 spread 处丢失。检查已选中 Chip 渲染后的 Web DOM,并在完成时确认 aria-checked 到达了交互节点。issue 没有提到测试文件,因此先找到现有的 Chip 无障碍测试。
由索引模型根据 Issue 内容生成。
描述
Description
Chip destructures selected/disabled/etc. and computes its own accessibilityState={{ selected, disabled }} internally, but any accessibilityState (or aria-checked) a caller passes in falls into ...rest and is spread onto the outer, non-interactive Surface — never reaching the interactive TouchableRipple/Pressable node.
This is a real accessibility gap on web: react-native-web does not derive aria-* attributes from a native accessibilityState object at all (confirmed via react-native-web's forwardedProps/index.js allowlist, which only forwards a literal aria-checked prop straight to the DOM). So even though Chip's own internally-computed accessibilityState happens to reach the real Pressable on native (where RN's Pressable merges accessibilityState.checked itself), there is no equivalent path on web, and Chip never sets aria-checked itself.
Net effect: a Chip rendered as part of a custom radio/checkbox group (e.g. a chip-based single/multi-select control) reports checked: false in the web accessibility tree for every option, including the selected one — a screen reader user on web cannot tell which option is selected.
Reproduction
- Render a
Chipwithselected={true}insidePaperProvider, on web (react-native-web). - Inspect the rendered DOM / accessibility tree.
- No
aria-checkedattribute is present anywhere in the output.
Expected behavior
Chip should forward a literal aria-checked prop (distinct from accessibilityState) through to the real interactive node it renders (TouchableRipple → Pressable), so consumers building a custom selectable-chip group can make selection state screen-reader-visible on web.
Additional context
- Verified the in-flight
6.0.0refactor (commit466d9c608d2cb3dead7831b64c925f4523419b0e, PR #5005, "refactor: migrate accessibility props to aria props") does not fix this: it addsrole/aria-label/aria-selected/aria-disabledforwarding toTouchableRipple, butChip's own vocabulary there isselected/aria-selected, notchecked/aria-checked— an unrecognizedaria-checkedis still spread via...restonto the non-interactiveSurfacein that version too. react-native-paperversion: 5.15.3 (latest stable at time of filing).- We've applied a local
patch-packagepatch forwardingaria-checkedthroughChip→TouchableRipple→Pressableas a workaround; happy to share the patch/diff if useful upstream.
- 主要语言
- TypeScript
- 星标
- 14.5k
- 派生
- 2.3k
- 平均合并
- 13 天 16 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/react-native-paper 的其他 Issue
-
Menu ignores the keyboard when it mounts while the keyboard is already open可能已有人在做 @manchoudhary 于 45 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
callstack/react-native-paper#5096 ·
维护者通常 17 天内回复
-
Color Picker Popup Is Obscured On "Guides -> Theming -> Creating Dynamic Theme Colors" Documentation On Both v5 and v6可能已有人在做 @fatihcvs 于 40 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
callstack/react-native-paper#5093 ·
维护者通常 17 天内回复
-
Tooltip: onPress event object is not propagated to parent component on native可能已有人在做 @Shevilll 于 131 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 74/100
callstack/react-native-paper#5003 ·
维护者通常 17 天内回复
-
Snackbar stays mounted after `visible=false` under new architecture (iOS + Android)可能已有人在做 @momomuchu 于 119 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
callstack/react-native-paper#4951 ·
维护者通常 17 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
callstack/react-native-paper#4881 ·
维护者通常 17 天内回复
查看 callstack/react-native-paper 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
lichess-org/lila#22324 · 1 条评论 ·
维护者通常 1 天内回复
-
ep:WebGPU platform:web quantization
难度 2/5 1-3 小时 新手友好度 66/100
microsoft/onnxruntime#33752 ·
维护者通常 2 天内回复
-
[Skill Bug]: entra-agent-id: inaccurate blueprint permission inheritance and parent token sub claim未关闭bug entra-agent-id
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/GitHub-Copilot-for-Azure#3467 · 1 条评论 ·
维护者通常 1 天内回复
-
fix(worker): keep normal prepare waiting states failure-free可能已有人在做 @LichKing-2234 今天认领。 未关闭agent:codex priority:P1
难度 2/5 1-3 小时 新手友好度 72/100
AgoraIO-Extensions/agent-infra#3745 ·
维护者通常 1 天内回复
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framing可能已有人在做 @Eapp1e 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
makecindy/cindy#7973 · 1 条评论 ·
维护者通常 1 天内回复