Skip to content

Commit a00f55e

Browse files
author
zd2017
committed
Add Enterkey-Processing for Japanese IME
DefaultIME isnot raise onEditorAction. but Using Japanese IME, it occures. so added handling of enterKey when ActionId is Zero
1 parent 43121cc commit a00f55e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tns-core-modules/ui/editable-text-base/editable-text-base.android.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,17 @@ function initializeEditTextListeners(): void {
101101
if (!owner) {
102102
return;
103103
}
104-
104+
//Patching for pressing enter-key on Japanese IME
105+
//(default IME isnot raise onEditorAction, but Japanese IME (Google日本語入力) raises this.
106+
// it's means that COULD NOT MAKE NEWLINE)
107+
if(actionId === 0 && (event && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER)){
108+
if (textView.getMaxLines() === 1) {
109+
owner.dismissSoftInput();
110+
}
111+
owner._onReturnPress();
112+
return false;
113+
}
114+
//End of Patch IME
105115
if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_DONE ||
106116
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_GO ||
107117
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH ||

0 commit comments

Comments
 (0)