Permalink
Browse files

TextInput: `onSubmitEditing` is now woriking with disabled `blurOnSub…

…mit`

Reviewed By: fmoo

Differential Revision: D5606771

fbshipit-source-id: 6b769553c08c56b93036e517f71e011b6ecd779b
  • Loading branch information...
shergin authored and facebook-github-bot committed Aug 11, 2017
1 parent 4510760 commit b06672e6cf7eee1f94e535aef2c49d8f6d7e8e16
Showing with 12 additions and 5 deletions.
  1. +12 −5 Libraries/Text/RCTTextInput.m
@@ -117,16 +117,23 @@ - (void)textInputDidBeginEditing
- (BOOL)textInputShouldReturn
{
return _blurOnSubmit;
}
- (void)textInputDidReturn
{
// We send `submit` event here, in `textInputShouldReturn`
// (not in `textInputDidReturn)`, because of semantic of the event:
// `onSubmitEditing` is called when "Submit" button
// (the blue key on onscreen keyboard) did pressed
// (no connection to any specific "submitting" process).
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit
reactTag:self.reactTag
text:self.backedTextInputView.text
key:nil
eventCount:_nativeEventCount];
return _blurOnSubmit;
}
- (void)textInputDidReturn
{
// Does nothing.
}
- (void)textInputDidChangeSelection

2 comments on commit b06672e

@janicduplessis

This comment has been minimized.

Show comment
Hide comment
@janicduplessis

janicduplessis Aug 11, 2017

Collaborator

This fixes #15299 right?

Collaborator

janicduplessis replied Aug 11, 2017

This fixes #15299 right?

@shergin

This comment has been minimized.

Show comment
Hide comment
@shergin

shergin Aug 11, 2017

Contributor

@janicduplessis Yes! 🎉 Thank you!

Contributor

shergin replied Aug 11, 2017

@janicduplessis Yes! 🎉 Thank you!

Please sign in to comment.