Permalink
Browse files

TextInput: textInputShouldEndEditing and textInputDidEndEditing were …

…moved to base class

Reviewed By: mmmulani

Differential Revision: D5395925

fbshipit-source-id: 0c67beccd74d981ab2a89f9cb31990301793b408
  • Loading branch information...
shergin authored and facebook-github-bot committed Jul 18, 2017
1 parent a50c9c8 commit f89e132719be9c60f470eae87d79f1d3d2627a9d
Showing with 22 additions and 40 deletions.
  1. +0 −20 Libraries/Text/RCTTextField.m
  2. +2 −0 Libraries/Text/RCTTextInput.h
  3. +20 −0 Libraries/Text/RCTTextInput.m
  4. +0 −20 Libraries/Text/RCTTextView.m
@@ -137,24 +137,4 @@ - (void)textInputDidChange
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
@@ -56,5 +56,7 @@
- (BOOL)textInputShouldReturn;
- (void)textInputDidReturn;
- (void)textInputDidChangeSelection;
- (BOOL)textInputShouldEndEditing;
- (void)textInputDidEndEditing;
@end
@@ -146,6 +146,26 @@ - (void)textInputDidChangeSelection
});
}
- (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)
- (CGSize)contentSize
@@ -373,26 +373,6 @@ - (void)textInputDidChange
});
}
- (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
- (void)scrollViewDidScroll:(UIScrollView *)scrollView

0 comments on commit f89e132

Please sign in to comment.