diff --git a/Libraries/Text/TextInput/Multiline/RCTUITextView.m b/Libraries/Text/TextInput/Multiline/RCTUITextView.m index 4ff8cc90ef42fc..96e7867c92c4aa 100644 --- a/Libraries/Text/TextInput/Multiline/RCTUITextView.m +++ b/Libraries/Text/TextInput/Multiline/RCTUITextView.m @@ -58,6 +58,15 @@ - (void)dealloc [[NSNotificationCenter defaultCenter] removeObserver:self]; } +#pragma mark - Accessibility + +- (void)setIsAccessibilityElement:(BOOL)isAccessibilityElement +{ + // UITextView is accessible by default (some nested views are) and disabling that is not supported. + // On iOS accessible elements cannot be nested, therefore enabling accessibility for some container view + // (even in a case where this view is a part of public API of TextInput on iOS) shadows some features implemented inside the component. +} + - (NSString *)accessibilityLabel { NSMutableString *accessibilityLabel = [NSMutableString new]; diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index 92db734ce7cd43..3d1af3d353970a 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -43,6 +43,15 @@ - (void)_textDidChange _textWasPasted = NO; } +#pragma mark - Accessibility + +- (void)setIsAccessibilityElement:(BOOL)isAccessibilityElement +{ + // UITextField is accessible by default (some nested views are) and disabling that is not supported. + // On iOS accessible elements cannot be nested, therefore enabling accessibility for some container view + // (even in a case where this view is a part of public API of TextInput on iOS) shadows some features implemented inside the component. +} + #pragma mark - Properties - (void)setTextContainerInset:(UIEdgeInsets)textContainerInset