diff --git a/Libraries/Text/RCTUITextView.m b/Libraries/Text/RCTUITextView.m index 7b4711a94..b260a73f8 100644 --- a/Libraries/Text/RCTUITextView.m +++ b/Libraries/Text/RCTUITextView.m @@ -52,6 +52,25 @@ static UIColor *defaultPlaceholderTextColor() [[NSNotificationCenter defaultCenter] removeObserver:self]; } +- (NSString *)accessibilityLabel +{ + NSMutableString *accessibilityLabel = [NSMutableString new]; + + NSString *superAccessibilityLabel = [super accessibilityLabel]; + if (superAccessibilityLabel.length > 0) { + [accessibilityLabel appendString:superAccessibilityLabel]; + } + + if (self.placeholderText.length > 0 && self.text.length == 0) { + if (accessibilityLabel.length > 0) { + [accessibilityLabel appendString:@" "]; + } + [accessibilityLabel appendString:self.placeholderText]; + } + + return accessibilityLabel; +} + #pragma mark - Properties - (void)setPlaceholderText:(NSString *)placeholderText