maraujop
maraujop

Reputation: 4594

How to prevent React Native to dismiss keyboard

In a react-native form, when switching from one TextInput to the next one, the second grabs focus for an instant and then suddenly RN dismisses the keyboard.

I have onSubmitEditing coded to move to next input, but the user needs to click on enter in the keyboard, I can also override onEndEditing however that forces you to move to the next input and maybe you didn't touch that one.

Upvotes: 0

Views: 3490

Answers (2)

Nima
Nima

Reputation: 1932

keyboardShouldPersistTaps={true} is deprecated so need to use keyboardShouldPersistTaps="always"

Upvotes: 1

maraujop
maraujop

Reputation: 4594

I found out that the problem is related to having TextInputs within a ScrollView, focus between inputs in this component doesn't work as expected.

Upvotes: 2

Related Questions