diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index 4b21e594b1bfd0..70a480be6c9af9 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -87,6 +87,22 @@ - (void)setEditable:(BOOL)editable self.enabled = editable; } +#pragma mark - Accessibility + +- (BOOL)isAccessibilityElement +{ + // Always return NO to enumerate child elements. Otherwise the "clear text" button is hidden + // from accessibility interface. + return NO; +} + +- (BOOL)accessibilityElementsHidden +{ + // If "accessible" prop is set to false on TextInput, disable all accessible children. + // Without this function the "clear text" UIButton is still exposed. + return ![super isAccessibilityElement]; +} + #pragma mark - Caret Manipulation - (CGRect)caretRectForPosition:(UITextPosition *)position