Commit a96ad8a
committed
DRAFT CPP solution to pass static string as accessibilityUnit
getOrCreateSpannableForText is not called. The method is called on the parent Text, but not on the Span Text.
Review implementation of accessibilityRole in [BaseViewManager](https://github.com/fabriziobertoglio1987/react-native/blob/ec4bc8eb5905f81cebbb4b623acda8245ee5683c/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java#L247) and [ReactMapBufferPropSetter.kt](http://www.apple.com/)
Probably the method setAccessibilityRole is called directly from kotlin MapBufferPropSetter
Add required changes and debug the functionality
accessibilityRole link is called, but time is not
they have the same cpp configuration, but one of them is not invoked in BaseViewManager.
This suggest missing configs from the [accessibility link PR](facebook@7b5b114), maybe accessibilityRole Link is triggered with resetAccessibilityDelegate
Find logic in accessibility link PR that resets the Delegate
Before resetting the Delegate, TextLayoutManager adds the Span to the Text. The field is TextAttributes mIsAccessibilityLink. This field is set to true if accessibilityRole = link
mIsAccessibilityLink is set to true in the ReactBaseTextShadowNode #setIsAccessibilityLink sets the value
Debug the value of ReactBaseTextShadowNode #setAccessibilityUnit
Verify if accessibilityUnit is retrieve in that method, because this manager is also for nested text
Check if setIsAccessibiltyLink also is triggered for role time, if not understand why text does not trigger. Yes, it is triggered. We set there the accessibilityRole
- We could follow the same implementation, we add the span based on mIsAccessibilityTtsSpan
- We retrieve get spans of class ReactTtsSpan
- We follow same implementation from accessibilityLinks
Implement same logic for accessibilityRole time
Verify accessibilityRole time is invoked
Use resetAccessibilityDelegate to add accessibilityUnit info to child Text
Copy missing changes from another prop (for ex. accessibilityRole). setAccessibilityRole is triggered, while setAccessibilityUnit is not triggered.
Review missing diff with [#2](https://github.com/fabriziobertoglio1987/react-native/pull/2/files)
Review the current diff with main branch
Add breakpoint in cpp
SOLUTION: adding the value in [attributedstring/conversion.h](https://github.com/fabriziobertoglio1987/react-native/blob/ec4bc8eb5905f81cebbb4b623acda8245ee5683c/ReactCommon/react/renderer/attributedstring/conversions.h#L1087) will then pass it to [TextAttributesProps as key 24](https://www.icloud.com/iclouddrive/0b8-oKB396zP7Astpyc3puGqQ#ACC_UNIT_passed_as_key_24)1 parent ec4bc8e commit a96ad8a
File tree
7 files changed
+38
-6
lines changed- ReactAndroid/src/main/java/com/facebook/react
- uimanager
- views
- text
- view
- ReactCommon/react/renderer/attributedstring
- packages/rn-tester/js/examples/Accessibility
7 files changed
+38
-6
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
| 511 | + | |
| 512 | + | |
510 | 513 | | |
511 | 514 | | |
512 | 515 | | |
| |||
519 | 522 | | |
520 | 523 | | |
521 | 524 | | |
| 525 | + | |
| 526 | + | |
522 | 527 | | |
523 | 528 | | |
524 | 529 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
206 | 210 | | |
207 | 211 | | |
208 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| |||
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
| 612 | + | |
| 613 | + | |
605 | 614 | | |
606 | 615 | | |
607 | 616 | | |
| |||
613 | 622 | | |
614 | 623 | | |
615 | 624 | | |
| 625 | + | |
| 626 | + | |
616 | 627 | | |
617 | 628 | | |
618 | 629 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| |||
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 288 | + | |
| 289 | + | |
293 | 290 | | |
294 | 291 | | |
295 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1083 | 1083 | | |
1084 | 1084 | | |
1085 | 1085 | | |
| 1086 | + | |
1086 | 1087 | | |
1087 | 1088 | | |
1088 | 1089 | | |
| |||
1226 | 1227 | | |
1227 | 1228 | | |
1228 | 1229 | | |
| 1230 | + | |
| 1231 | + | |
1229 | 1232 | | |
1230 | 1233 | | |
| 1234 | + | |
| 1235 | + | |
1231 | 1236 | | |
1232 | 1237 | | |
1233 | 1238 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| |||
0 commit comments