Repository navigation
fix(Chip): forward accessibilityState prop correctly - #5168
bhumikabiyani wants to merge 3 commits into
Conversation
|
Found potential problems with the pull request:
|
|
We've now decided how a toggle Chip exposes its state in 6.x: on the web it uses |
|
Yes, absolutely! Thanks for clarifying the intended 6.x behavior. I'll rework the PR accordingly, using |
|
Thanks for explaining! I've updated the PR based on your suggestion.
I've also updated the PR description. The tests, typecheck, and lint checks are passing. Please have a look when you get a chance. Thanks! |
Motivation
Align
Chipaccessibility behavior with the conventions established for the 6.x release.aria-pressedonly when the caller explicitly provides theselectedprop, allowing screen readers to identify toggle button state.accessibilityStateandaria-checkedforwarding to avoid exposing unsupported or misplaced accessibility attributes.Related issue
Related to #5180
Screenshots / Videos
N/A — accessibility behavior change with no visual UI changes.
Test plan
selectedis omitted,true, andfalse.true, andfalsevalues.accessibilityStateandaria-checkedare not forwarded to unintended elements.yarn test src/components/__tests__/Chip.test.tsxyarn typecheck