Skip to content

fix(chip): use aria-pressed on web for role button - #5192

Open
EnesKartal wants to merge 1 commit into
callstack:mainfrom
EnesKartal:fix/chip-web-aria-pressed-5180
Open

EnesKartal wants to merge 1 commit into
callstack:mainfrom
EnesKartal:fix/chip-web-aria-pressed-5180

Conversation

@EnesKartal

Copy link
Copy Markdown

Fixes #5180

Summary of Changes

  • Web Accessibility: On web, when role === "button", using aria-selected violates W3C ARIA specifications and triggers axe-core aria-allowed-attr violations.
    • When role === "button" on web, aria-pressed={selected} is emitted instead of aria-selected.
    • When selected is undefined (e.g. action chips without selection state), neither aria-pressed nor aria-selected is emitted.
    • When selected is provided on native or when role is not button (such as option or tab), aria-selected is preserved.
  • Tests:
    • Added accessibility test suite verifying aria-pressed on web, omitting state for plain action chips, and maintaining aria-selected for native and non-button roles.
    • Updated snapshot expectations where action chips previously emitted selected: false.

Test Plan

  • Run yarn test src/components/__tests__/Chip.test.tsx (all 32 tests pass).
  • Run yarn typescript (typechecks cleanly).

Copilot AI balanced review requested due to automatic review settings November 7, 2026 22:28
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Found potential problems with the pull request:

  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chip: on the web every Chip sets aria-selected on role button

2 participants