Page 1 of 1

Keyboard Focus On Startup.

Posted: Fri Dec 16, 2022 9:09 am
by Googie85
Hi Guys!!

I am trying to close the Android keyboard on startup. It focuses on a Field automatically upon the App startup. I have tried:

On openStack
"focus on nothing"
End openStack

I have also set the focus on other images to try and disable the keyboard.

Any suggestions on what I could do to remove the keyboard on startup?

Many Thanks,

Googie.

Re: Keyboard Focus On Startup.

Posted: Fri Dec 16, 2022 7:29 pm
by jacque
That's made me crazy since MetaCard and I think there's a bug report about it. For now, you have to implement a workaround. The field selection is the very last thing that happens after the card is fully rendered so trying to fix it in preOpen* anything won't work.

I usually set the traversalOn of the field to false in preOpenCard and send a message to set it back to true in a few milliseconds, which assumes the card will be fully rendered by then. This works if there is only one editable field but if there are more, the next one will be activated instead. You can loop through them all if necessary.

If you're on a Windows machine you can put a button at layer 1 and if its traversalOn is true, that will be activated instead (or it used to be, I haven't tried it in years.) Buttons don't trigger the keyboard. But that doesn't work on Macs so I don't use it. I expect it won't work on mobile either.

BTW, turning off autofocus also fails.