I’m having trouble getting the “next” key on the iPhone keyboard to advance to the next form field in a user login form, from email input box to password input box. The documentation notes to use native.setKeyboardFocus() to tell set the next input box by name rather than relying on the “next” in iOS.
However, doing this…setReturnKey(playerPasswordInput) causes the app to crash on device when the scene loads.
Is the issue that playerPasswordInput isn’t declared until after native.setKeyboardFocus() or is there a better way to handle text input form boxes?
scene.buildAccountForm = function(event) playerEmailInput = native.newTextField(260, 135, 200, 22) playerEmailInput:addEventListener("userInput", textListener) playerEmailInput:setTextColor(.7, .7, .7) playerEmailInput.maxLength = 100 playerEmailInput.defaultText = "example@example.com" playerEmailInput.isFontSizeScaled = true playerEmailInput.size = 16 playerEmailInput.align = "left" playerEmailInput.text = "example@example.com" playerEmailInput.hasBackground = true playerEmailInput:setReturnKey(playerPasswordInput) -- instead of ("next") playerEmailInput.isValid = false scene.loginGroup:insert(playerEmailInput) playerPasswordInput = native.newTextField(260, 170, 200, 22)