You should use a FlatList with keyboardShouldPersistTaps={'handled'} support and close the keyboard with another function using Keyboard.Dissmiss() . your FlatList will look like this:
<FlatList keyboardShouldPersistTaps={'handled'} data={[{key: 'item 1'}, {key: 'item 2'}]} renderItem={({item}) => <TouchableHighlight onPress={() => console.log('item press')} underlayColor='#dddddd'> <View style={{height: 40}}> <Text style={{fontSize: 16, textAlign: 'center'}}>{item.key}</Text> </View> </TouchableHighlight> } />
You can use the Keyboard.dismiss() function in the onPress after the console.log('item press') command in the TouchableHighlight component.
source share