Skip to content

Commit 9ebf1ba

Browse files
author
Marc Mulcahy
committed
Add additional role and states as per comments.
1 parent 2969c73 commit 9ebf1ba

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

proposals/0000-a11y-roles-states-improvements.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Improvements to accessibilityRole and accessibilityStates
33
author:
44
- Marc Mulcahy
5-
date: 2018-10-31
5+
date: 2019-02-06
66
---
77

88
## Summary
@@ -41,6 +41,7 @@ This proposal adds the following roles:
4141
- radiogroup
4242
- scrollbar
4343
- spinbutton
44+
- switch
4445
- tab
4546
- tablist
4647
- timer
@@ -54,14 +55,18 @@ This proposal adds the following states:
5455
- off
5556
- checked
5657
- unchecked
58+
- busy
59+
- expanded
60+
- collapsed
61+
- hasPopup
5762

5863
### Fallback Mechanism for Roles
5964

6065
There are several roles which don't have native analogs on a given platform. For such roles, a fallback mechanism will be used.
6166

6267
#### Android
6368

64-
The fallback mechanism is already in place on Android. For roles which don't have standard Android view analogs, the class name of the AccessibilityNodeInfo is set to an arbitrary value, and the roleDescription extra is set to a localized textual description of the role.
69+
The fallback mechanism is already in place on Android. For roles which don't have standard Android view analogs, the class name of the AccessibilityNodeInfo is set to the class name of the closest native Android view type, and the roleDescription extra is set to a localized textual description of the role.
6570

6671
### Fire OS
6772

@@ -74,13 +79,21 @@ The role string should not be localized-- it should be one of the constants defi
7479

7580
#### iOS
7681

77-
For roles which don't have a corresponding iOS accessibilityTrait, we recommend appending a localized version of the role description to the accessibility label.
82+
For roles which don't have a corresponding iOS accessibilityTrait, we recommend appending a localized version of the role description to the accessibilityValue of the component.
7883

7984
### Additional States Implementation Notes
8085

81-
Android has slightly more robust state support than does iOS. Both the new checked and on states will be exposed directly by setting the isCheckable and isChecked members of the corresponding AccessibilityNodeInfo.
86+
Android has slightly more robust state support than does iOS. The following states can be represented with Android'd standard accessibility API:
8287

83-
on iOS, the solution is less clear. Unless a better solution is found, we propose to add a textual description of the state to the accessibilityLabel.
88+
- checked
89+
- unchecked
90+
- expanded
91+
- collapsed
92+
- hasPopup
93+
94+
We will append a localized description of other states to the component's content description.
95+
96+
on iOS, a localized description of states which do not have corresponding accessibilityTraits will be appended to the component's accessibilityValue.
8497

8598
## Drawbacks
8699

@@ -94,7 +107,7 @@ The only alternative is to recommend that developers append the role and state i
94107

95108
## Adoption strategy
96109

97-
We should document the roles as part of the official accessibility API documentation. Developers can then start using them if they choose.
110+
We should document the additional roles and states as part of the official accessibility API documentation. Developers can then start using them if they choose.
98111

99112
## How we teach this
100113

@@ -103,4 +116,3 @@ The attempt with this proposal is to bring React Native accessibility support on
103116
## Unresolved questions
104117

105118
- Roles imply supported states and behaviors. For example, checkboxes imply the checked state, and the ability to be toggled. Radio groups typically only allow one child to be selected, etc. When a component specifies its role, should this programmatically require the developer to implement certain behaviors? Alternatively, what mechanisms exist to present warnings during compile time for missing behaviors?
106-
- How should components notify assistive technologies of state changes?

0 commit comments

Comments
 (0)