Skip to content

Commit 7f25e6c

Browse files
committed
Revert "Only generate recursive accessibility label for accessible elements (#51988)"
This reverts commit 7e2f17f.
1 parent 7bfadb4 commit 7f25e6c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,10 +1230,7 @@ - (NSString *)accessibilityLabel
12301230
return label;
12311231
}
12321232

1233-
if (self.isAccessibilityElement) {
1234-
return RCTRecursiveAccessibilityLabel(self.currentContainerView);
1235-
}
1236-
return nil;
1233+
return RCTRecursiveAccessibilityLabel(self.currentContainerView);
12371234
}
12381235

12391236
- (NSString *)accessibilityLabelForCoopting

packages/react-native/React/Views/RCTView.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,7 @@ - (NSString *)accessibilityLabel
240240
if (label) {
241241
return label;
242242
}
243-
if (self.isAccessibilityElement) {
244-
return RCTRecursiveAccessibilityLabel(self);
245-
}
246-
return nil;
243+
return RCTRecursiveAccessibilityLabel(self);
247244
}
248245

249246
- (NSArray<UIAccessibilityCustomAction *> *)accessibilityCustomActions

0 commit comments

Comments
 (0)