Skip to content

Commit

Permalink
Don't return empty string for accessibilityLabel for RCTView
Browse files Browse the repository at this point in the history
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 d4ff5ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ - (UIView *)react_findClipView
[str appendString:label];
}
}
return str;
return str.length == 0 ? nil : str;
}

@implementation RCTView
Expand Down

2 comments on commit d4ff5ed

@sammy-SC
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up.

Please sign in to comment.