TextInput: Unified support of clearTextOnFocus prop

Summary: The implementation of `clearTextOnFocus` was unified and moved to baseclass.

Reviewed By: javache

Differential Revision: D5299489

fbshipit-source-id: ff166f9bb0673ff8766f20b677f56810f64d7b2d
This commit is contained in:
Valentin Shergin
2017-07-18 14:33:41 -07:00
committed by Facebook Github Bot
parent cb96f1d5d2
commit d69e60bb7a
7 changed files with 28 additions and 35 deletions

View File

@@ -329,19 +329,6 @@ static NSAttributedString *removeReactTagFromString(NSAttributedString *string)
}
}
- (void)textInputDidBeginEditing
{
if (_clearTextOnFocus) {
_backedTextInput.text = @"";
}
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus
reactTag:self.reactTag
text:nil
key:nil
eventCount:_nativeEventCount];
}
static BOOL findMismatch(NSString *first, NSString *second, NSRange *firstRange, NSRange *secondRange)
{
NSInteger firstMismatch = -1;