Skip to content

refactor: migrate accessibility props to aria props#5005

Open
MrMuzyk wants to merge 6 commits into
callstack:mainfrom
MrMuzyk:refactor/migrate-accessiblity-props-to-aria-props
Open

refactor: migrate accessibility props to aria props#5005
MrMuzyk wants to merge 6 commits into
callstack:mainfrom
MrMuzyk:refactor/migrate-accessiblity-props-to-aria-props

Conversation

@MrMuzyk

@MrMuzyk MrMuzyk commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Motivation

React Native added aria-* props as web-compatible aliases for the legacy accessibility* props. This PR migrates the library's internal usage across all components to the modern API, so components work correctly with React Native Web and align with the direction RN is taking the accessibility API.

Changes

Mapping applied uniformly:

  • accessibilityLabelaria-label
  • accessibilityRolerole
  • accessibilityState={{ disabled }}aria-disabled
  • accessibilityState={{ selected }}aria-selected
  • accessibilityState={{ checked }}aria-checked
  • accessibilityState={{ expanded }}aria-expanded

TextInput additionally replaces accessibilityState: { disabled, invalid } with aria-disabled and aria-invalid. Because aria-invalid is not yet in RN's AccessibilityProps type (RN 0.85.3), GetAccessibilityDataReturn.input uses an intersection type AccessibilityProps & { 'aria-invalid'?: boolean }.

BREAKING CHANGE: aria-* props take precedence over accessibility* props in React Native when both are set on the same element. Consumers who pass accessibilityLabel, accessibilityRole, or accessibilityState to Paper components to override defaults will be silently ignored after this bump.

Related issue

N/A

Test plan

yarn typescript clean
yarn lint clean
yarn jest — 9 test files updated to query/assert on aria-* props instead of accessibilityState/accessibilityLabel; 28 snapshot files regenerated to reflect the prop rename in the render tree. Full suite passes.

@MrMuzyk MrMuzyk marked this pull request as ready for review June 22, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants