Skip to content

Commit d68e94b

Browse files
authored
Fix onSubmitEditing not being called on single-line TextInput (#458)
1 parent ebc8370 commit d68e94b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ - (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doComman
175175
// enter/return
176176
if (commandSelector == @selector(insertNewline:) || commandSelector == @selector(insertNewlineIgnoringFieldEditor:)) {
177177
[self textFieldDidEndEditingOnExit];
178+
if ([[_backedTextInputView textInputDelegate] textInputShouldReturn]) {
179+
[[_backedTextInputView window] makeFirstResponder:nil];
180+
}
178181
commandHandled = YES;
179182
//backspace
180183
} else if (commandSelector == @selector(deleteBackward:)) {

0 commit comments

Comments
 (0)