Commit 9f43581
accessibilityLabelledBy use DynamicFromObject to parse String to Dynamic (#34371)
Summary:
`accessibilityLabelledBy` accepts String or Array type.
- The JavaScript Array type corresponds to java [ReadableArray][3] ([HybridData][4])
- The JavaScript String type corresponds to the java String
Use [DynamicFromObject][5] to parse String to Dynamic.
https://github.com/facebook/react-native/blob/e509f96baf5e523301a5c9567c416508ff20d175/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java#L222-L228
All credits to [grgr-dkrk][1] (PR #32470). fixes [https://github.com/facebook/react-native/issues/30846][2]
## Changelog
[Android] [Fixed] - accessibilityLabelledBy use DynamicFromObject to parse String to Dynamic
Pull Request resolved: #34371
Test Plan:
<details><summary>testing accessibilityLabelledBy with TextInput</summary>
<p>
https://user-images.githubusercontent.com/24992535/183593138-7ced1974-6a06-4f0f-822a-1ade1edc7212.mp4
</p>
</details>
<details><summary>testing accessibilityLabelledBy with Switch</summary>
<p>

</p>
</details>
<details><summary>testing paper renderer after the fix</summary>
<p>
https://user-images.githubusercontent.com/24992535/183605619-01f1be64-788a-43bd-88b0-a7b2cad75148.mp4
</p>
</details>
[1]: https://github.com/grgr-dkrk
[2]: #30846
[3]: https://github.com/facebook/react-native/blob/e509f96baf5e523301a5c9567c416508ff20d175/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableArray.java#L1
[4]: https://github.com/facebookincubator/fbjni/blob/main/java/com/facebook/jni/HybridData.java
[5]: https://github.com/facebook/react-native/blob/e509f96baf5e523301a5c9567c416508ff20d175/ReactAndroid/src/main/java/com/facebook/react/bridge/DynamicFromObject.java#L74
Reviewed By: lunaleaps
Differential Revision: D38706360
Pulled By: huntie
fbshipit-source-id: e4771552d3fddfad50f4d4cbbf971fe4a718e1341 parent 3d21852 commit 9f43581
File tree
2 files changed
+14
-1
lines changed- ReactAndroid/src/main/java/com/facebook/react/uimanager
- packages/rn-tester/js/examples/Accessibility
2 files changed
+14
-1
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
231 | 242 | | |
232 | 243 | | |
233 | 244 | | |
| |||
0 commit comments