From 8f7630640854d9aac26b92fbde0ce1349887185c Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Thu, 19 Apr 2018 17:32:40 +0200 Subject: [PATCH 1/2] Fixes #4461 --- .../ui/editable-text-base/editable-text-base.android.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts b/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts index c4c0a999e2..30b892aaa8 100644 --- a/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts +++ b/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts @@ -121,7 +121,7 @@ function initializeEditTextListeners(): void { actionId === android.view.inputmethod.EditorInfo.IME_ACTION_GO || actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH || actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEND || - (event && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER)) { + (actionId !== android.view.inputmethod.EditorInfo.IME_ACTION_UNSPECIFIED && event && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER)) { // If it is TextField, close the keyboard. If it is TextView, do not close it since the TextView is multiline // https://github.com/NativeScript/NativeScript/issues/3111 if (textView.getMaxLines() === 1) { From c1ceb687336873e205254c3bb7c70bd3e44462f2 Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Fri, 20 Apr 2018 20:48:14 +0200 Subject: [PATCH 2/2] I think we don't need these because TextView never triggers the returnPress event anyway. --- .../ui/editable-text-base/editable-text-base.android.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts b/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts index 30b892aaa8..3bb6925f64 100644 --- a/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts +++ b/tns-core-modules/ui/editable-text-base/editable-text-base.android.ts @@ -115,9 +115,7 @@ function initializeEditTextListeners(): void { return false; } - if (actionId === android.view.inputmethod.EditorInfo.IME_NULL || - actionId === android.view.inputmethod.EditorInfo.IME_ACTION_UNSPECIFIED || - actionId === android.view.inputmethod.EditorInfo.IME_ACTION_DONE || + if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_DONE || actionId === android.view.inputmethod.EditorInfo.IME_ACTION_GO || actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH || actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEND ||