Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,13 @@ - (NSObject *)accessibilityElement
NSMutableString *result = [NSMutableString stringWithString:@""];
for (UIView *subview in view.subviews) {
NSString *label = subview.accessibilityLabel;
if (!label) {
static Class otherClass = nil;
static BOOL otherClassLookedUp = NO;
if (!otherClass && !otherClassLookedUp) {
otherClass = NSClassFromString(@"RCTView");
otherClassLookedUp = YES;
}
if (!label && ![subview isKindOfClass:[RCTViewComponentView class]] && ![subview isKindOfClass:otherClass]) {
label = RCTRecursiveAccessibilityLabel(subview);
}
if (label && label.length > 0) {
Expand Down
8 changes: 7 additions & 1 deletion React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ - (UIView *)react_findClipView
NSMutableString *str = [NSMutableString stringWithString:@""];
for (UIView *subview in view.subviews) {
NSString *label = subview.accessibilityLabel;
if (!label) {
static Class otherClass = nil;
static BOOL otherClassLookedUp = NO;
if (!otherClass && !otherClassLookedUp) {
otherClass = NSClassFromString(@"RCTViewComponentView");
otherClassLookedUp = YES;
}
if (!label && ![subview isKindOfClass:[RCTView class]] && ![subview isKindOfClass:otherClass]) {
label = RCTRecursiveAccessibilityLabel(subview);
}
if (label && label.length > 0) {
Expand Down