mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #3189 from NativeScript/issue-3111
Fix: TextView new line closes virtual keyboard on Android
This commit is contained in:
@@ -107,7 +107,12 @@ export class EditableTextBase extends common.EditableTextBase {
|
|||||||
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEND ||
|
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_SEND ||
|
||||||
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT ||
|
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT ||
|
||||||
(event && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER)) {
|
(event && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER)) {
|
||||||
owner.dismissSoftInput();
|
|
||||||
|
// If it is TextField, close the keyboard. If it is TextView, do not close it since the TextView is multiline
|
||||||
|
// https://github.com/NativeScript/NativeScript/issues/3111
|
||||||
|
if (textView.getMaxLines() === 1){
|
||||||
|
owner.dismissSoftInput();
|
||||||
|
}
|
||||||
owner._onReturnPress();
|
owner._onReturnPress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user