react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

TextInput autoFocus does not pull up Keyboard

Open rissois opened this issue 4 years ago • 0 comments

PROBLEM

While autoFocus is called, the Keyboard does not appear (see Side note below). Note that this a duplicate of #1645 , but as that was already closed and the previous posts were not helpful, I thought a new thread would be appropriate.

REPRO

Please open this CodeSandbox example (copied from another post) on an iPhone to test. The keyboard does not show.

Side note:

<TextInput
  ref={textInputRef}
  autoFocus
  onFocus={() => {
    console.log(!!textInputRef?.current?.focus) // oddly false, despite onFocus being called
    textInputRef?.current?.focus()
    console.log(!!textInputRef?.current?.focus) // true, but Keyboard still does not open
  })
/>

<Button onPress={() => textInputRef?.current?.focus()} /> // Keyboard does open when pressed

rissois avatar Dec 11 '21 03:12 rissois