Commit 1db1d89
Announce collapsed state for expanded: false on iOS (#58748)
Summary:
On the new architecture, VoiceOver reads nothing for `aria-expanded={false}` / `accessibilityState={{expanded: false}}`, so a collapsed accordion header sounds like a plain button. `RCTViewComponentView` only adds "expanded" to the accessibility value when the state is true and has no branch for false. The old `RCTView` announces "collapsed" there, and so does TalkBack.
This adds the missing branch, reusing the same localized "collapsed" string `RCTView.m` already has. An unset `expanded` still adds nothing.
Fixes #58746
## Changelog:
[IOS] [FIXED] - VoiceOver announces "collapsed" for `aria-expanded={false}` on the new architecture
Pull Request resolved: #58748
Test Plan: Added XCTest cases to `RCTViewComponentViewTests.mm` for `expanded` true, false and unset. Ran the repo's clang-format on both files. I couldn't run the iOS tests locally (no Xcode on this machine), so they rely on CI.
Reviewed By: cipolleschi
Differential Revision: D122875216
Pulled By: zeyap
fbshipit-source-id: ecca5825fcb6443cbaca57a3998be1efac893c351 parent 425a284 commit 1db1d89
2 files changed
Lines changed: 42 additions & 3 deletions
File tree
- packages/react-native/React
- Fabric/Mounting/ComponentViews/View
- Tests/Mounting
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1614 | 1614 | | |
1615 | 1615 | | |
1616 | 1616 | | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
1620 | 1626 | | |
1621 | 1627 | | |
1622 | 1628 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
241 | 274 | | |
242 | 275 | | |
243 | 276 | | |
| |||
0 commit comments