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.
This commit is contained in:
Evan Payne
2017-09-25 14:46:01 +02:00
committed by Nikolay Tsonev
parent d8caf5583c
commit b0577728be

View File

@ -113,11 +113,13 @@ function initializeEditTextListeners(): void {
owner.dismissSoftInput(); owner.dismissSoftInput();
} }
owner._onReturnPress(); owner._onReturnPress();
return true;
} }
// If action is ACTION_NEXT then do not close keyboard // If action is ACTION_NEXT then do not close keyboard
if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT) { if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT) {
owner._onReturnPress(); owner._onReturnPress();
return true;
} }
return false; return false;
@ -432,4 +434,4 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
this.nativeViewProtected.setFilters(newFilters); this.nativeViewProtected.setFilters(newFilters);
} }
} }
} }