Permalink
Browse files

`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
  • Loading branch information...
shergin authored and facebook-github-bot committed Jun 27, 2017
1 parent f954f3d commit 719f0005f67eeb0910fb921cb07984dae5f84e90
Showing with 11 additions and 0 deletions.
  1. +1 −0 Libraries/Text/RCTUITextField.h
  2. +10 −0 Libraries/Text/RCTUITextField.m
@@ -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
@@ -71,6 +71,16 @@ - (void)_updatePlaceholder
attributes:attributes];
}
- (BOOL)isEditable
{
return self.userInteractionEnabled;
}
- (void)setEditable:(BOOL)editable
{
self.userInteractionEnabled = editable;
}
#pragma mark - Caret Manipulation
- (CGRect)caretRectForPosition:(UITextPosition *)position

0 comments on commit 719f000

Please sign in to comment.