You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/0000-a11y-roles-states-improvements.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Improvements to accessibilityRole and accessibilityStates
3
3
author:
4
4
- Marc Mulcahy
5
-
date: 2018-10-31
5
+
date: 2019-02-06
6
6
---
7
7
8
8
## Summary
@@ -41,6 +41,7 @@ This proposal adds the following roles:
41
41
- radiogroup
42
42
- scrollbar
43
43
- spinbutton
44
+
- switch
44
45
- tab
45
46
- tablist
46
47
- timer
@@ -54,14 +55,18 @@ This proposal adds the following states:
54
55
- off
55
56
- checked
56
57
- unchecked
58
+
- busy
59
+
- expanded
60
+
- collapsed
61
+
- hasPopup
57
62
58
63
### Fallback Mechanism for Roles
59
64
60
65
There are several roles which don't have native analogs on a given platform. For such roles, a fallback mechanism will be used.
61
66
62
67
#### Android
63
68
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.
65
70
66
71
### Fire OS
67
72
@@ -74,13 +79,21 @@ The role string should not be localized-- it should be one of the constants defi
74
79
75
80
#### iOS
76
81
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.
78
83
79
84
### Additional States Implementation Notes
80
85
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:
82
87
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.
84
97
85
98
## Drawbacks
86
99
@@ -94,7 +107,7 @@ The only alternative is to recommend that developers append the role and state i
94
107
95
108
## Adoption strategy
96
109
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.
98
111
99
112
## How we teach this
100
113
@@ -103,4 +116,3 @@ The attempt with this proposal is to bring React Native accessibility support on
103
116
## Unresolved questions
104
117
105
118
- 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