From b0577728be4c691da112c7da9aeb6c5f2046bff9 Mon Sep 17 00:00:00 2001 From: Evan Payne Date: Mon, 25 Sep 2017 14:46:01 +0200 Subject: [PATCH] Return true if user has consumed the action (#4859) Based on this: https://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html And assuming that the developer will run dismissSoftInput in the owner.dismissSoftInput() only if they need to. Returning False will close the keyboard regardless. --- .../ui/editable-text-base/editable-text-base.android.ts | 4 +++- 1 file changed, 3 insertions(+), 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 4ff920c34..b34b1866c 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 @@ -113,11 +113,13 @@ function initializeEditTextListeners(): void { owner.dismissSoftInput(); } owner._onReturnPress(); + return true; } // If action is ACTION_NEXT then do not close keyboard if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT) { owner._onReturnPress(); + return true; } return false; @@ -432,4 +434,4 @@ export abstract class EditableTextBase extends EditableTextBaseCommon { this.nativeViewProtected.setFilters(newFilters); } } -} \ No newline at end of file +}