From d68e94b9f8c7d0597cabdf0a747c319f66f33f1a Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Fri, 19 Jun 2020 22:52:15 +0200 Subject: [PATCH] Fix onSubmitEditing not being called on single-line TextInput (#458) --- Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m b/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m index 69a793c213..06a5c53ebc 100644 --- a/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +++ b/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m @@ -175,6 +175,9 @@ BOOL RCTEventIsCommandEnterEvent(NSEvent *event) { // enter/return if (commandSelector == @selector(insertNewline:) || commandSelector == @selector(insertNewlineIgnoringFieldEditor:)) { [self textFieldDidEndEditingOnExit]; + if ([[_backedTextInputView textInputDelegate] textInputShouldReturn]) { + [[_backedTextInputView window] makeFirstResponder:nil]; + } commandHandled = YES; //backspace } else if (commandSelector == @selector(deleteBackward:)) {