`editable` property was implemented for RCTUITextField

Summary: `UITextField` surprisingly does not have `editable` property (only UITextView does), so we have to implement it ourselfs.

Reviewed By: javache

Differential Revision: D5153070

fbshipit-source-id: 5a76c623fc5c7c3eec10c600c942cf82c93833cd
This commit is contained in:
Valentin Shergin 2017-06-27 16:04:59 -07:00 committed by Facebook Github Bot
parent f954f3d9b6
commit 719f0005f6
2 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign, readonly) BOOL textWasPasted;
@property (nonatomic, strong, nullable) UIColor *placeholderColor;
@property (nonatomic, assign) UIEdgeInsets textContainerInset;
@property (nonatomic, assign, getter=isEditable) BOOL editable;
@end

View File

@ -71,6 +71,16 @@
attributes:attributes];
}
- (BOOL)isEditable
{
return self.userInteractionEnabled;
}
- (void)setEditable:(BOOL)editable
{
self.userInteractionEnabled = editable;
}
#pragma mark - Caret Manipulation
- (CGRect)caretRectForPosition:(UITextPosition *)position