mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert "Fix accessibility event properties for TextInput (#24641)"
This reverts commit 0a3bbcd1b2.
This commit is contained in:
@@ -289,16 +289,16 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
|
||||
- (void)setSecureTextEntry:(BOOL)secureTextEntry {
|
||||
UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
|
||||
|
||||
|
||||
if (textInputView.secureTextEntry != secureTextEntry) {
|
||||
textInputView.secureTextEntry = secureTextEntry;
|
||||
|
||||
|
||||
// Fix #5859, see https://stackoverflow.com/questions/14220187/uitextfield-has-trailing-whitespace-after-securetextentry-toggle/22537788#22537788
|
||||
NSAttributedString *originalText = [textInputView.attributedText copy];
|
||||
self.backedTextInputView.attributedText = [NSAttributedString new];
|
||||
self.backedTextInputView.attributedText = originalText;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - RCTBackedTextInputDelegate
|
||||
@@ -405,7 +405,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
}
|
||||
|
||||
NSString *previousText = backedTextInputView.attributedText.string ?: @"";
|
||||
|
||||
|
||||
if (range.location + range.length > backedTextInputView.attributedText.string.length) {
|
||||
_predictedText = backedTextInputView.attributedText.string;
|
||||
} else {
|
||||
@@ -511,6 +511,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
return fittingSize;
|
||||
}
|
||||
|
||||
#pragma mark - Accessibility
|
||||
|
||||
- (UIView *)reactAccessibilityElement
|
||||
{
|
||||
return self.backedTextInputView;
|
||||
}
|
||||
|
||||
#pragma mark - Focus Control
|
||||
|
||||
- (void)reactFocus
|
||||
|
||||
@@ -34,7 +34,6 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
#pragma mark - Unified <TextInput> properties
|
||||
|
||||
RCT_REMAP_VIEW_PROPERTY(accessibilityLabel, reactAccessibilityElement.accessibilityLabel, NSString)
|
||||
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, backedTextInputView.autocapitalizationType, UITextAutocapitalizationType)
|
||||
RCT_REMAP_VIEW_PROPERTY(autoCorrect, backedTextInputView.autocorrectionType, UITextAutocorrectionType)
|
||||
RCT_REMAP_VIEW_PROPERTY(contextMenuHidden, backedTextInputView.contextMenuHidden, BOOL)
|
||||
|
||||
Reference in New Issue
Block a user