Skip to content
Permalink
Browse files

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
  • Loading branch information...
sammy-SC authored and facebook-github-bot committed May 20, 2019
1 parent 4a5d0bd commit d4ff5ed258b75fe77c5d801af7b097b04fcd3690
Showing with 1 addition and 1 deletion.
  1. +1 −1 React/Views/RCTView.m
@@ -95,7 +95,7 @@ - (UIView *)react_findClipView
[str appendString:label];
}
}
return str;
return str.length == 0 ? nil : str;
}

@implementation RCTView

2 comments on commit d4ff5ed

@sammy-SC

This comment has been minimized.

Copy link
Contributor Author

replied May 20, 2019

hey @rigdern ,

just heads up, I made a small change to RCTRecursiveAccessibilityLabel because it was returning an empty string so often it populated accessibilityLabel with @"".

@rigdern

This comment has been minimized.

Copy link
Contributor

replied May 20, 2019

Thanks for the heads up.

Please sign in to comment.
You can’t perform that action at this time.