Chip: on the web every Chip sets aria-selected on role button
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react-native, typescript
- Domain
- accessibility, frontend
Research direction
Start in Chip.tsx, where the issue says aria-selected is passed and selected defaults to false; compare the web behavior with native before changing it. Check the Chip example at /chip and run axe-core on the web app to confirm the violation is gone and a selected toggle exposes its state. Done when plain action chips omit toggle state and selected web chips use the supported button state.
Written by the indexing model from the issue text.
Description
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 |
- Dominant language
- TypeScript
- Stars
- 14.5k
- Forks
- 2.3k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/react-native-paper
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
callstack/react-native-paper#5189 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
callstack/react-native-paper#5187 ·
Maintainers usually reply within 1 day
-
Accessibility example app good first task
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
callstack/react-native-paper#5182 ·
Maintainers usually reply within 1 day
-
Chip: accessibilityState passed by caller is discarded; aria-checked is never forwarded to the real rendered nodePossibly taken @bhumikabiyani claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
callstack/react-native-paper#5146 · 2 comments ·
Maintainers usually reply within 1 day
-
Tooltip: onPress event object is not propagated to parent component on nativePossibly taken @aliyilmaztech claimed this 86 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
callstack/react-native-paper#5003 ·
Maintainers usually reply within 1 day
All issues in callstack/react-native-paper
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
pending close triaging
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
anomalyco/opencode#62582 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
live-codes/livecodes#1079 · 1 comment ·
Maintainers usually reply within 1 day
-
Add: ESP 2 ROOpenapproved check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day