naDan
naDan

Reputation: 83

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

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.

Upvotes: 1

Views: 677

Answers (1)

Developer DanX
Developer DanX

Reputation: 46

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 (doc)

Upvotes: 3

Related Questions