Skip to content

Commit 00bb498

Browse files
author
Vladimir Enchev
committed
TextField returnPress event will be raised if event KeyCode is ENTER
1 parent a3b85ec commit 00bb498

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

ui/editable-text-base/editable-text-base.android.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,9 @@ export class EditableTextBase extends common.EditableTextBase {
8484
var editorActionListener = new android.widget.TextView.OnEditorActionListener({
8585
onEditorAction: function (textView: android.widget.TextView, actionId: number, event: android.view.KeyEvent): boolean {
8686
var owner = that.get();
87-
if (owner) {
88-
if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_DONE ||
89-
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_GO ||
90-
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH ||
91-
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEND ||
92-
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT) {
93-
owner.dismissSoftInput();
94-
owner._onReturnPress();
95-
}
87+
if (owner && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER) {
88+
owner.dismissSoftInput();
89+
owner._onReturnPress();
9690
}
9791

9892
return false;

0 commit comments

Comments
 (0)