4

I have an input box in react, I have passed the focus prop to make the input focused when someone lands on the component.

On Android, it works well, it focuses the input and pops up the keyboard.

On iOS, it does not work well, it focuses the input but does not shows the keyboard implicitly. I need to click on the input again to pops the keyboard.

I want that as soon as the user lands on the page, the keyboard shows up.

Here is the code: https://github.com/ritikbanger/react18-input-otp/blob/main/src/lib/index.jsx

Here is code sand box for the same: https://codesandbox.io/s/react18-input-otp-0nxzx7?file=/src/App.js

I have tried the following solutions but does not worked:

  1. IOS show keyboard on input focus
  2. displaying keyboard in Safari iOS after focus on input after page loads (modal shows) in Angular
  3. How do I focus an HTML text field on an iPhone (causing the keyboard to come up)?
  4. show keyboard on input focus without user action
Ritik Banger
  • 2,107
  • 5
  • 25

0 Answers0