TextField returnPress event will be raised if event KeyCode is ENTER

This commit is contained in:
Vladimir Enchev
2016-03-09 11:58:29 +02:00
parent dcd389e0de
commit 6704abbc66

View File

@ -84,15 +84,9 @@ export class EditableTextBase extends common.EditableTextBase {
var editorActionListener = new android.widget.TextView.OnEditorActionListener({ var editorActionListener = new android.widget.TextView.OnEditorActionListener({
onEditorAction: function (textView: android.widget.TextView, actionId: number, event: android.view.KeyEvent): boolean { onEditorAction: function (textView: android.widget.TextView, actionId: number, event: android.view.KeyEvent): boolean {
var owner = that.get(); var owner = that.get();
if (owner) { if (owner && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER) {
if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_DONE || owner.dismissSoftInput();
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_GO || owner._onReturnPress();
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH ||
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEND ||
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT) {
owner.dismissSoftInput();
owner._onReturnPress();
}
} }
return false; return false;