Click next moves the focus to next focusable textfield (#5047)

* Click next moves the focus to next focusable textfield

Fixes https://github.com/NativeScript/NativeScript/issues/5033
When clicking next arrow on the virtual keyboard we were returning true which means we handled the event so the OS doesn't move the focus to the next item. This PR delete the `return true` when the action is `IME_ACTION_NEXT` so that next focusable item is automatically focued

* Fix IME_ACTION_PREVIOUS to raise returnPress event.
Added unit-test that IME_ACTION_PREVIOUS to raise returnPress event.
Refactored text-field-tests
This commit is contained in:
Hristo Hristov
2017-11-10 16:34:47 +02:00
committed by GitHub
parent 43fbabb5e9
commit 725475f860
2 changed files with 236 additions and 168 deletions

View File

@@ -117,9 +117,9 @@ function initializeEditTextListeners(): void {
}
// 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
|| actionId === android.view.inputmethod.EditorInfo.IME_ACTION_PREVIOUS) {
owner._onReturnPress();
return true;
}
return false;