Commit 87d3504
Make role-based interactive views keyboard-focusable on iOS
Summary:
On iOS, Full Keyboard Access decides whether a Fabric view can take keyboard focus
from its UIKit accessibility trait mask. That mask is a lossy projection of the
`role` / `accessibilityRole` prop: `checkbox`, `radio`, `combobox`, `dropdownlist`,
`menuitem`, `spinbutton`, `tab`, and the ARIA `option`, `searchbox`, `slider` and
`treeitem` all resolve to no interactive trait, because VoiceOver conveys those
roles through `accessibilityValue` instead. Controls authored with any of them were
unreachable with a keyboard - a WCAG 2.1.1 (Keyboard) failure.
Derive focusability from the role as well as the trait mask. Behaviour is otherwise
unchanged: views that opt out of accessibility (`accessible={false}`) and views with
no interactive role stay unfocusable, VoiceOver is untouched (it keys off
`isAccessibilityElement`), and tvOS keeps its existing `focusable` path.
Changelog:
[iOS][Fixed] - Views with checkbox, radio, combobox, dropdownlist, menuitem, spinbutton, tab, option, searchbox, slider and treeitem roles are now reachable via Full Keyboard Access
Differential Revision: D1147840561 parent df5e6f6 commit 87d3504
2 files changed
Lines changed: 106 additions & 3 deletions
File tree
- packages/react-native/React
- Fabric/Mounting/ComponentViews/View
- Tests/Mounting
Lines changed: 52 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
55 | 104 | | |
56 | 105 | | |
57 | 106 | | |
| |||
1508 | 1557 | | |
1509 | 1558 | | |
1510 | 1559 | | |
1511 | | - | |
| 1560 | + | |
1512 | 1561 | | |
1513 | 1562 | | |
1514 | 1563 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
186 | 240 | | |
0 commit comments