OnPress Function Fires only after Tapping Twice when Keyboard Present React Native Issue Fix

This is a common react native issue especially when you use TextInput with ScrollView / FlatList as parent. In such cases, the other components like button respond only when you click or tap outside of the TextInput twice.

To solve this React Native issue, you have to use keyboardShouldPersistTaps prop with ScrollView or FlatList. Then you only need to tap once outside of the TextInput. Add keyboardShouldPersistTaps=’always’ to ScrollView or FlatList and then children of the ScrollView can catch the taps.

For more information, you can go through official document on keyboardShouldPersistTaps.

1 thought on “OnPress Function Fires only after Tapping Twice when Keyboard Present React Native Issue Fix”

Leave a Reply

%d bloggers like this: