Chip: accessibilityState passed by caller is discarded; aria-checked is never forwarded to the real rendered node
維護者通常 12 天內回覆
還沒有人認領這個 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
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 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 於 44 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
callstack/react-native-paper#5096 ·
維護者通常 12 天內回覆
-
Color Picker Popup Is Obscured On "Guides -> Theming -> Creating Dynamic Theme Colors" Documentation On Both v5 and v6可能已有人在做 @fatihcvs 於 39 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 68/100
callstack/react-native-paper#5093 ·
維護者通常 12 天內回覆
-
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 ·
維護者通常 12 天內回覆
-
Snackbar stays mounted after `visible=false` under new architecture (iOS + Android)可能已有人在做 @momomuchu 於 119 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
callstack/react-native-paper#4951 ·
維護者通常 12 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
callstack/react-native-paper#4881 ·
維護者通常 12 天內回覆
查看 callstack/react-native-paper 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
marmelab/react-admin#11431 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
db-ux-design-system/core-web#8655 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effect未關閉bug
難度 2/5 1-3 小時 新手友好度 66/100
epam/statgpt-admin-frontend#305 ·
維護者通常 1 天內回覆