From ae113aa697d8eeef508d8c41fb64e7d38b3360b4 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 12 Dec 2019 12:46:33 -0800 Subject: [PATCH] Refinements in RCTBackedTextInputViewProtocol protocol Summary: RCTBackedTextInputViewProtocol is a protocol that describes which capabilities must be exposed for some TextInput-like UIView to be compatible with the rest of TextInput infra. We use that in both implementations. In Classic React Native we use Objective-C runtime mechanisms to call many of those methods (via ViewManager's directives); that masked the problem that the protocol was incomplete. In Fabric, we call all methods normally, so we need to declare all of them here. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D18950432 fbshipit-source-id: 3cd5cb57a033f7c43fd5f2c10f9706408e8e6d0c --- .../Text/TextInput/RCTBackedTextInputViewProtocol.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h b/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h index 649a0a182f9..fa593dbfa0b 100644 --- a/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +++ b/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h @@ -14,18 +14,24 @@ NS_ASSUME_NONNULL_BEGIN @protocol RCTBackedTextInputViewProtocol -@property (nonatomic, strong, nullable) UIColor *textColor; -@property (nonatomic, strong, nullable) UIFont *font; +@property (nonatomic, strong, nullable) UIColor *textColor; // TODO: T57162853 Merge with `defaultTextAttributes`. +@property (nonatomic, strong, nullable) UIFont *font; // TODO: T57162853 Merge with `defaultTextAttributes`. @property (nonatomic, copy, nullable) NSAttributedString *attributedText; @property (nonatomic, copy, nullable) NSString *placeholder; @property (nonatomic, strong, nullable) UIColor *placeholderColor; -@property (nonatomic, assign) NSTextAlignment textAlignment; +@property (nonatomic, assign) NSTextAlignment textAlignment; // TODO: T57162853 Merge with `defaultTextAttributes`. @property (nonatomic, assign, readonly) BOOL textWasPasted; @property (nonatomic, assign) UIEdgeInsets textContainerInset; @property (nonatomic, strong, nullable) UIView *inputAccessoryView; @property (nonatomic, weak, nullable) id textInputDelegate; @property (nonatomic, readonly) CGSize contentSize; @property (nonatomic, strong, nullable) NSDictionary *defaultTextAttributes; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically; +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; // This protocol disallows direct access to `selectedTextRange` property because // unwise usage of it can break the `delegate` behavior. So, we always have to