Home > Mobile >  How to open Android and IOS keyboard in React Native without pressing the TextInput
How to open Android and IOS keyboard in React Native without pressing the TextInput

Time:12-08

I am working on the comment section of an Android and iOS application in react native, the problem is that I try to open the keyboard when the user clicks on the "Reply to comment" button. If you can help me by guiding me how to bring up the keyboard just by tapping on a button, or by tapping anywhere but not on the TextInput. the best would be to link a TextInput with a button to display the keyboard which will enter the data in the TextInput

Merci.

CodePudding user response:

This is related to https://stackoverflow.com/a/42456639/20717090

> The keyboard should open automatically when a <TextField /> is
> focused. You can use the autoFocus prop to make it focus when the
> element mounts ([link][https://reactnative.dev/docs/textinput.html#autofocus])
  • Related