Skip to content

Commit

Permalink
Merge pull request #21 from skillz/bug-leading-spaces-accessibility-l…
Browse files Browse the repository at this point in the history
…abel

[#152985076] stop prepending multiple spaces to accessibility labels
  • Loading branch information
padawerd authored Nov 20, 2017
2 parents 3877778 + d5a9039 commit 6164549
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ - (UIView *)react_findClipView
NSMutableString *str = [NSMutableString stringWithString:@""];
for (UIView *subview in view.subviews) {
NSString *label = subview.accessibilityLabel;
if (label) {
[str appendString:@" "];
if (!label) {
label = RCTRecursiveAccessibilityLabel(subview);
}
if (label && label.length > 0) {
if (str.length > 0) {
[str appendString:@" "];
}
[str appendString:label];
} else {
[str appendString:RCTRecursiveAccessibilityLabel(subview)];
}
}
return str;
Expand Down

0 comments on commit 6164549

Please sign in to comment.