From d4ff5ed258b75fe77c5d801af7b097b04fcd3690 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 20 May 2019 01:30:35 -0700 Subject: [PATCH] Don't return empty string for `accessibilityLabel` for RCTView Summary: In case `RCTView` had no subviews, `RCTRecursiveAccessibilityLabel` was returning an empty string rather than nil. I've noticed that https://fburl.com/i95iynxi returns empty string as well. Shall we change it there as well? Reviewed By: shergin Differential Revision: D15337865 fbshipit-source-id: 8e38a88321f3dcfdf35a38d43fdbe4f5118796f1 --- React/Views/RCTView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 6463980533f..39cdcaa974a 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -95,7 +95,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) [str appendString:label]; } } - return str; + return str.length == 0 ? nil : str; } @implementation RCTView