zlFast
zlFast

Reputation: 353

How to click on row when TextInput is focused? (react-native)

If I click on any ListView item, TouchableOpacity work fine. But when TextInput focused - it doesn't work, you need to tap twice. First click on item will only remove focus from TextInput. How to make it work without removing focus (in one click). Thanks.

Upvotes: 2

Views: 907

Answers (2)

Arnaud Christ
Arnaud Christ

Reputation: 3551

Great answer from Maksim. With the latest releases of react-native, you should use

keyboardShouldPersistTaps='always'

As keyboardShouldPersistTaps={true} is now deprecated.

Upvotes: 1

Maksim
Maksim

Reputation: 2466

You need to add keyboardShouldPersistTaps={true} on the ListView

Upvotes: 9

Related Questions