Custom State Descriptions

This issue has been tracked since 2022-09-20.

Description

Description
Android added support for custom state descriptions in API 30. This allows for much richer announcements on elements that have more complex state than “selected”. For example, a play/pause button on a video player could have the state description of “platying” or “paused”.

These are powered by the setStateDescription property on the View and AccessibilityNodeInfo classes (https://developer.android.com/reference/android/view/View#setStateDescription(java.lang.CharSequence)).

This largely maps to the accessibilityValue property on iOS, so it may make sense to map the “text” value of that prop to stateDescription rather than concatenating it into the contentDescription as we do today.

Expected Behavior
When an element has stateDescription set, on focus the state is announced. On change of that state, only the change is announced, for example a video play button that has a state of “playing” that when clicked pauses, would automatically announce “paused” (the new state).

Version

0.66

Output of npx react-native info

see description

Steps to reproduce

see description

Snack, code example, screenshot, or link to a repository

see description

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-10-03
Star Count 105144
Watcher Count 3666
Fork Count 22469
Issue Count 2232

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date