Skip to content

Commit 8382ca1

Browse files
committed
Revert "Fix accessibility event properties for TextInput (#24641)"
This reverts commit 0a3bbcd.
1 parent 74d740c commit 8382ca1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Libraries/Text/TextInput/RCTBaseTextInputView.m

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,16 @@ - (BOOL)secureTextEntry {
289289

290290
- (void)setSecureTextEntry:(BOOL)secureTextEntry {
291291
UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
292-
292+
293293
if (textInputView.secureTextEntry != secureTextEntry) {
294294
textInputView.secureTextEntry = secureTextEntry;
295-
295+
296296
// Fix #5859, see https://stackoverflow.com/questions/14220187/uitextfield-has-trailing-whitespace-after-securetextentry-toggle/22537788#22537788
297297
NSAttributedString *originalText = [textInputView.attributedText copy];
298298
self.backedTextInputView.attributedText = [NSAttributedString new];
299299
self.backedTextInputView.attributedText = originalText;
300300
}
301-
301+
302302
}
303303

304304
#pragma mark - RCTBackedTextInputDelegate
@@ -405,7 +405,7 @@ - (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSStrin
405405
}
406406

407407
NSString *previousText = backedTextInputView.attributedText.string ?: @"";
408-
408+
409409
if (range.location + range.length > backedTextInputView.attributedText.string.length) {
410410
_predictedText = backedTextInputView.attributedText.string;
411411
} else {
@@ -511,6 +511,13 @@ - (CGSize)sizeThatFits:(CGSize)size
511511
return fittingSize;
512512
}
513513

514+
#pragma mark - Accessibility
515+
516+
- (UIView *)reactAccessibilityElement
517+
{
518+
return self.backedTextInputView;
519+
}
520+
514521
#pragma mark - Focus Control
515522

516523
- (void)reactFocus

Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ @implementation RCTBaseTextInputViewManager
3434

3535
#pragma mark - Unified <TextInput> properties
3636

37-
RCT_REMAP_VIEW_PROPERTY(accessibilityLabel, reactAccessibilityElement.accessibilityLabel, NSString)
3837
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, backedTextInputView.autocapitalizationType, UITextAutocapitalizationType)
3938
RCT_REMAP_VIEW_PROPERTY(autoCorrect, backedTextInputView.autocorrectionType, UITextAutocorrectionType)
4039
RCT_REMAP_VIEW_PROPERTY(contextMenuHidden, backedTextInputView.contextMenuHidden, BOOL)

0 commit comments

Comments
 (0)