File tree 4 files changed +26
-2
lines changed
React/Fabric/Mounting/ComponentViews/View
ReactCommon/react/renderer/components/view
4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ - (BOOL)shouldGroupAccessibilityChildren
630
630
NSMutableArray <UIAccessibilityCustomAction *> *customActions = [NSMutableArray array ];
631
631
for (auto const &accessibilityAction : accessibilityActions) {
632
632
[customActions
633
- addObject: [[UIAccessibilityCustomAction alloc ] initWithName: RCTNSStringFromString (accessibilityAction)
633
+ addObject: [[UIAccessibilityCustomAction alloc ] initWithName: RCTNSStringFromString (accessibilityAction.name )
634
634
target: self
635
635
selector: @selector (didActivateAccessibilityCustomAction: )]];
636
636
}
Original file line number Diff line number Diff line change 7
7
8
8
#pragma once
9
9
10
+ #include < better/optional.h>
10
11
#include < cinttypes>
12
+ #include < string>
11
13
12
14
namespace facebook {
13
15
namespace react {
@@ -45,6 +47,11 @@ constexpr enum AccessibilityTraits operator&(
45
47
return (enum AccessibilityTraits)((uint32_t )lhs & (uint32_t )rhs);
46
48
}
47
49
50
+ struct AccessibilityAction {
51
+ std::string name{" " };
52
+ better::optional<std::string> label{};
53
+ };
54
+
48
55
struct AccessibilityState {
49
56
bool disabled{false };
50
57
bool selected{false };
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class AccessibilityProps {
29
29
AccessibilityState accessibilityState;
30
30
std::string accessibilityLabel{" " };
31
31
std::string accessibilityHint{" " };
32
- std::vector<std::string > accessibilityActions{};
32
+ std::vector<AccessibilityAction > accessibilityActions{};
33
33
bool accessibilityViewIsModal{false };
34
34
bool accessibilityElementsHidden{false };
35
35
bool accessibilityIgnoresInvertColors{false };
Original file line number Diff line number Diff line change @@ -192,5 +192,22 @@ inline void fromRawValue(
192
192
}
193
193
}
194
194
195
+ inline void fromRawValue (const RawValue &value, AccessibilityAction &result) {
196
+ auto map = (better::map<std::string, RawValue>)value;
197
+
198
+ auto name = map.find (" name" );
199
+ react_native_assert (name != map.end () && name->second .hasType <std::string>());
200
+ if (name != map.end ()) {
201
+ fromRawValue (name->second , result.name );
202
+ }
203
+
204
+ auto label = map.find (" label" );
205
+ if (label != map.end ()) {
206
+ if (label->second .hasType <std::string>()) {
207
+ result.label = (std::string)label->second ;
208
+ }
209
+ }
210
+ }
211
+
195
212
} // namespace react
196
213
} // namespace facebook
You can’t perform that action at this time.
0 commit comments