From d5a9039a2aa38083ea4af6f1974eaae1499f52e4 Mon Sep 17 00:00:00 2001 From: David Padawer Date: Mon, 20 Nov 2017 13:47:47 -0800 Subject: [PATCH] [#152985076] stop prepending multiple spaces to accessibility labels --- React/Views/RCTView.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 0aa03e462ae7e7..5726a0c6fec098 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -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;