TextInput: textInputShouldEndEditing and textInputDidEndEditing were moved to base class

Reviewed By: mmmulani

Differential Revision: D5395925

fbshipit-source-id: 0c67beccd74d981ab2a89f9cb31990301793b408
This commit is contained in:
Valentin Shergin 2017-07-18 14:33:47 -07:00 committed by Facebook Github Bot
parent a50c9c8e22
commit f89e132719
4 changed files with 22 additions and 40 deletions

View File

@ -137,24 +137,4 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
eventCount:_nativeEventCount]; eventCount:_nativeEventCount];
} }
- (BOOL)textInputShouldEndEditing
{
return YES;
}
- (void)textInputDidEndEditing
{
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur
reactTag:self.reactTag
text:self.text
key:nil
eventCount:_nativeEventCount];
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd
reactTag:self.reactTag
text:_backedTextInput.text
key:nil
eventCount:_nativeEventCount];
}
@end @end

View File

@ -56,5 +56,7 @@
- (BOOL)textInputShouldReturn; - (BOOL)textInputShouldReturn;
- (void)textInputDidReturn; - (void)textInputDidReturn;
- (void)textInputDidChangeSelection; - (void)textInputDidChangeSelection;
- (BOOL)textInputShouldEndEditing;
- (void)textInputDidEndEditing;
@end @end

View File

@ -146,6 +146,26 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
}); });
} }
- (BOOL)textInputShouldEndEditing
{
return YES;
}
- (void)textInputDidEndEditing
{
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd
reactTag:self.reactTag
text:self.backedTextInputView.text
key:nil
eventCount:_nativeEventCount];
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur
reactTag:self.reactTag
text:self.backedTextInputView.text
key:nil
eventCount:_nativeEventCount];
}
#pragma mark - Content Size (in Yoga terms, without any insets) #pragma mark - Content Size (in Yoga terms, without any insets)
- (CGSize)contentSize - (CGSize)contentSize

View File

@ -373,26 +373,6 @@ static BOOL findMismatch(NSString *first, NSString *second, NSRange *firstRange,
}); });
} }
- (BOOL)textInputShouldEndEditing
{
return YES;
}
- (void)textInputDidEndEditing
{
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd
reactTag:self.reactTag
text:_backedTextInput.text
key:nil
eventCount:_nativeEventCount];
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur
reactTag:self.reactTag
text:nil
key:nil
eventCount:_nativeEventCount];
}
#pragma mark - UIScrollViewDelegate #pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView - (void)scrollViewDidScroll:(UIScrollView *)scrollView