I am creating an InputBox class that is basically a modal form with a single textbox field. The desired behavior is to automatically give focus to the textbox, and bring up the virtual keyboard on mobile devices. While Chrome automatically selects the text field, I can’t get it to work on Safari. I’ve tried calling .Focus in the form Load() event, but no dice. Any suggestions?
Thank you. It seems on Safari it is reliant on a user initiated action, and the click to show the form is too far removed: https://stackoverflow.com/questions/6287478/mobile-safari-autofocus-text-field
The .focus call is allowed from non-click actions if app is run from homescreen, or if a setting on the webview is set directly.
I have spent many countless hours trying to find a way around this problem but to no avail. iOS/Safari prevents this behavior, unfortunately. If I find a way around it, I will let you know.
The closest solution I have found is to create a button and have that trigger the focus event (after clicking).
I hope this helps a little bit, it’s a difficult issue! Please feel free to reach out if you have any other questions.
Please login first to submit.