Skip to content

fix: avoid disabled accessibility state for active chips#5011

Open
vivekjm wants to merge 1 commit into
callstack:mainfrom
vivekjm:fix-chip-accessibility-state
Open

fix: avoid disabled accessibility state for active chips#5011
vivekjm wants to merge 1 commit into
callstack:mainfrom
vivekjm:fix-chip-accessibility-state

Conversation

@vivekjm

@vivekjm vivekjm commented Jun 22, 2026

Copy link
Copy Markdown

Motivation

Fixes an accessibility regression where Chips without an explicit disabled prop can still be exposed as disabled/dimmed to screen readers. TouchableRipple marks itself disabled when no touch handler is present, so informational or selected Chips could inherit a disabled accessibility state even though the Chip itself is not disabled.

This keeps explicitly disabled Chips disabled, while allowing non-disabled Chips to remain active from an accessibility perspective.

Related issue

Fixes #4844

Test plan

  • yarn test src/components/__tests__/Chip.test.tsx --runInBand -u
  • yarn eslint src/components/Chip/Chip.tsx src/components/__tests__/Chip.test.tsx
  • yarn typescript

Also attempted the default pre-commit hook, which runs full lint/types/tests. Lint and most tests ran, but the full Jest run failed in src/babel/__tests__/index.js because this checkout does not have lib/mappings.json generated.

@matkoson matkoson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

src/components/Chip/Chip.tsx:217 @vivekjm wouldn't this make non-interactive chips ripple when pressed?

generated by an automated pr-review pipe, not written by a human. reply and tag the repo owner if it got something wrong.

@vivekjm

vivekjm commented Jun 25, 2026

Copy link
Copy Markdown
Author

Thanks for checking this. The intent is not to make non-interactive chips behave as actionable controls, only to prevent them from being exposed as disabled to accessibility APIs when the Chip itself is not disabled.\n\nThe fallback no-op handler is only used when the chip is not disabled and no touch handler was passed. It avoids TouchableRipple deriving a disabled accessibility state from the missing handler; explicitly disabled chips still pass through as disabled, and chips with real handlers still use their provided onPress/onPressIn/onPressOut behavior.\n\nIf you prefer avoiding a no-op onPress entirely, I can rework this to keep the accessibility state independent from TouchableRipple's disabled inference instead.

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 announces to screen readers as "dimmed" even when active

2 participants