TextInput: onSubmitEditing is now woriking with disabled blurOnSubmit

Reviewed By: fmoo

Differential Revision: D5606771

fbshipit-source-id: 6b769553c08c56b93036e517f71e011b6ecd779b
This commit is contained in:
Valentin Shergin 2017-08-10 18:09:35 -07:00 committed by Facebook Github Bot
parent 4510760447
commit b06672e6cf

View File

@ -117,16 +117,23 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
- (BOOL)textInputShouldReturn - (BOOL)textInputShouldReturn
{ {
return _blurOnSubmit; // We send `submit` event here, in `textInputShouldReturn`
} // (not in `textInputDidReturn)`, because of semantic of the event:
// `onSubmitEditing` is called when "Submit" button
- (void)textInputDidReturn // (the blue key on onscreen keyboard) did pressed
{ // (no connection to any specific "submitting" process).
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit
reactTag:self.reactTag reactTag:self.reactTag
text:self.backedTextInputView.text text:self.backedTextInputView.text
key:nil key:nil
eventCount:_nativeEventCount]; eventCount:_nativeEventCount];
return _blurOnSubmit;
}
- (void)textInputDidReturn
{
// Does nothing.
} }
- (void)textInputDidChangeSelection - (void)textInputDidChangeSelection