javascript – Keyboard not showing up on iOS when focusing input element


I’m testing a webpage on iOS. I am trying to allow tab-like behavior when the user presses the enter key, so I’ve written some code to focus the next element when that happens.

I also have an element that, when focused, immediately focuses a child input element. When I focus this parent with my enter/tab simulation, it brings focus to the child, but the keyboard does not show up.

I can make the keyboard show up if I tap this child input. Moreover, if I use the real tab button to focus the parent, the keyboard shows up when focus is delegated to the child input. I have verified that the child input is indeed being focused by checking document.activeElement, and when I test on a computer I can type in the input without any additional clicks after focusing it with enter. The input is outlined in blue as well, so it is visibly focused.

And, lastly, this bug does not occur when the next element is directly an input. I press enter and the input receives focus and the keyboard shows up.

Is this an iOS bug? I’ve tested in both Safari and DuckDuckGo browsers. (I don’t have a non-iPhone mobile device to test with to see if this is an issue with mobile devices in general.)

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img