Commit 98d84e5
Feat/accessibility state alias (#34524)
Summary:
This adds aliasing for accessibility state, it's used as requested on #34424.
- [aria-disabled](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled) to equivalent [accessibilityState.disabled](https://reactnative.dev/docs/accessibility#accessibilitystate)
- [aria-busy](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-busy) to equivalent [accessibilityState.busy](https://reactnative.dev/docs/accessibility#accessibilitystate)
- [aria-checked](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked) to equivalent [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate)
- [aria-expanded](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded) to equivalent [accessibilityState.expanded](https://reactnative.dev/docs/accessibility#accessibilitystate)
- [aria-selected](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected) to equivalent [accessibilityState.selected](https://reactnative.dev/docs/accessibility#accessibilitystate)
## Changelog
[General] [Added] - Add aria-disabled, aria-busy, aria-checked, aria-expanded and aria-selected prop to core components
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
Pull Request resolved: #34524
Test Plan:
```js
<View
aria-disabled={true}
aria-selected={false}
aria-checked={true}
aria-expanded={true}
aria-busy={true}
style={{backgroundColor: '#527FE4', padding: 5}}>
<Text style={{fontSize: 11}}>Blue background</Text>
</View>
```
Reviewed By: cipolleschi
Differential Revision: D39137790
Pulled By: jacdebug
fbshipit-source-id: 27b5c56e91731ba36bb4754d9862286a7a8191bc1 parent a562216 commit 98d84e5
File tree
21 files changed
+475
-53
lines changed- Libraries
- Components
- Pressable
- __tests__/__snapshots__
- TextInput
- __tests__/__snapshots__
- Touchable
- __tests__/__snapshots__
- View
- __tests__/__snapshots__
- Image
- __tests__/__snapshots__
- Text
- packages/rn-tester/js/examples/Accessibility
21 files changed
+475
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
270 | 281 | | |
271 | 282 | | |
272 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
273 | 290 | | |
274 | 291 | | |
275 | 292 | | |
| |||
298 | 315 | | |
299 | 316 | | |
300 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
301 | 326 | | |
302 | 327 | | |
303 | 328 | | |
304 | | - | |
| 329 | + | |
305 | 330 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
310 | 335 | | |
311 | 336 | | |
312 | 337 | | |
| |||
337 | 362 | | |
338 | 363 | | |
339 | 364 | | |
340 | | - | |
| 365 | + | |
341 | 366 | | |
342 | 367 | | |
343 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| |||
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
182 | | - | |
| 193 | + | |
183 | 194 | | |
184 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
185 | 202 | | |
186 | 203 | | |
187 | 204 | | |
| |||
210 | 227 | | |
211 | 228 | | |
212 | 229 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
217 | 240 | | |
218 | 241 | | |
219 | 242 | | |
220 | 243 | | |
221 | 244 | | |
222 | | - | |
| 245 | + | |
223 | 246 | | |
224 | 247 | | |
225 | 248 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
| |||
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
24 | 42 | | |
25 | 43 | | |
26 | 44 | | |
| |||
54 | 72 | | |
55 | 73 | | |
56 | 74 | | |
| 75 | + | |
| 76 | + | |
57 | 77 | | |
| 78 | + | |
| 79 | + | |
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
| |||
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
| 103 | + | |
| 104 | + | |
81 | 105 | | |
| 106 | + | |
| 107 | + | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
| |||
118 | 144 | | |
119 | 145 | | |
120 | 146 | | |
| 147 | + | |
| 148 | + | |
121 | 149 | | |
| 150 | + | |
| 151 | + | |
122 | 152 | | |
123 | 153 | | |
124 | 154 | | |
| |||
142 | 172 | | |
143 | 173 | | |
144 | 174 | | |
| 175 | + | |
| 176 | + | |
145 | 177 | | |
| 178 | + | |
| 179 | + | |
146 | 180 | | |
147 | 181 | | |
148 | 182 | | |
| |||
184 | 218 | | |
185 | 219 | | |
186 | 220 | | |
| 221 | + | |
187 | 222 | | |
188 | 223 | | |
| 224 | + | |
| 225 | + | |
189 | 226 | | |
190 | 227 | | |
191 | 228 | | |
| |||
209 | 246 | | |
210 | 247 | | |
211 | 248 | | |
| 249 | + | |
212 | 250 | | |
213 | 251 | | |
| 252 | + | |
| 253 | + | |
214 | 254 | | |
215 | 255 | | |
216 | 256 | | |
| |||
260 | 300 | | |
261 | 301 | | |
262 | 302 | | |
| 303 | + | |
| 304 | + | |
263 | 305 | | |
| 306 | + | |
| 307 | + | |
264 | 308 | | |
265 | 309 | | |
266 | 310 | | |
| |||
284 | 328 | | |
285 | 329 | | |
286 | 330 | | |
| 331 | + | |
| 332 | + | |
287 | 333 | | |
| 334 | + | |
| 335 | + | |
288 | 336 | | |
289 | 337 | | |
290 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1342 | 1350 | | |
1343 | 1351 | | |
1344 | 1352 | | |
| |||
1360 | 1368 | | |
1361 | 1369 | | |
1362 | 1370 | | |
| 1371 | + | |
1363 | 1372 | | |
1364 | 1373 | | |
1365 | 1374 | | |
| |||
1407 | 1416 | | |
1408 | 1417 | | |
1409 | 1418 | | |
| 1419 | + | |
1410 | 1420 | | |
1411 | 1421 | | |
1412 | 1422 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
| |||
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
34 | 52 | | |
35 | 53 | | |
36 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| |||
139 | 151 | | |
140 | 152 | | |
141 | 153 | | |
142 | | - | |
| 154 | + | |
143 | 155 | | |
144 | 156 | | |
145 | 157 | | |
| |||
0 commit comments