diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 168fbab46eaa7f..5b5f0b95213003 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -148,7 +148,7 @@ - (void)setAttributedText:(NSAttributedString *)attributedText NSString *currentScreenreaderError = self.backedTextInputView.currentScreenreaderError; NSString *previousScreenreaderError = self.backedTextInputView.previousScreenreaderError; BOOL errorMessageRemoved = currentScreenreaderError == nil && ![currentScreenreaderError isEqualToString: previousScreenreaderError]; - if (currentScreenreaderError == nil && errorMessageRemoved) { + if (errorMessageRemoved) { BOOL validString = attributedText && [attributedText.string length] != 0; NSString *lastChar = validString ? [attributedText.string substringFromIndex:[attributedText.string length] - 1] : @""; self.backedTextInputView.accessibilityValue = nil; diff --git a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js index 2ad56bfb717131..70496ff243a682 100644 --- a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js +++ b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js @@ -736,24 +736,7 @@ class AccessibilityActionsExample extends React.Component<{}> { - { - switch (event.nativeEvent.actionName) { - case 'activate': - Alert.alert('Alert', 'Activate accessiblity action'); - break; - case 'copy': - Alert.alert('Alert', 'copy action success'); - break; - } - }}> - Text - + Text ); @@ -1185,13 +1168,10 @@ function AccessibilityErrorWithButtons(): React.Node { accessibilityInvalid={accessibilityInvalid} onChangeText={newText => { setText(newText); - setError('the newText is: ' + newText); if (newText === 'Error') { + setError('the newText is: ' + newText); setAccessibilityInvalid(true); - } else if (newText === 'empty') { - setError(newText); - setAccessibilityInvalid(true); - } else if (newText === 'null') { + } else { setError(''); setAccessibilityInvalid(false); }