TextField ReturnKeyType not working in Android


#1

I imported login page through SideKick (NativeScript + Javascript). ReturnKeyType does not response for first text field input, but it works on the second input. Tried in both phone & emulator with android API 23 and above.

Here is my xml code

    <StackLayout class="p-t-15">
        <TextField class="txt m-t-10 m-b-10 m-l-15 m-r-15" hint="USER ID" color="#fff" keyboardType="number" ReturnKeyType="next" autocorrect="false" autocapitalization="none"
            text="{{ username }}"></TextField>
        <TextField class="txt m-t-10 m-b-10 m-l-15 m-r-15" hint="PASSWORD" color="#fff" secure="true" ReturnKeyType="go" autocorrect="false" autocapitalization="none"
            text="{{ password }}"></TextField>

        <Button class="btn btn-primary" text="LOG IN" tap="onSigninButtonTap"></Button>
    </StackLayout>

#2

I think there is a bug here, it was fixed so you will see the fix in the next update 3.4 https://github.com/NativeScript/NativeScript/pull/5047

However, in the mean time you can use returnPress property, it gives you more control. for example:

<TextField returnPress="OnUsernameDoneTap" class="txt m-t-10 m-b-10 m-l-15 m-r-15" hint="USER ID" color="#fff" keyboardType="number"  autocorrect="false" autocapitalization="none" text="{{ username }}"></TextField>
function OnUsernameDoneTap(args) {
 page.getViewById("password").focus();
}
exports.OnUsernameDoneTap = OnUsernameDoneTap;