Posts

Showing posts with the label react-native-flatlist

When textInput focused, first touch on flatList doesn't work, however the second works

When textInput focused, first touch on flatList doesn't work, however the second works When I type something into TextInput, then I touch one of FlatList items first time. It should console.log('item press'), but it not. Only the second touch It consoles. Does someone know the reason? This is my code. <TextInput placeholder='test' value={this.state.inputText} onChangeText={(inputText) => this.setState({inputText})} style={{marginBottom: 20, fontSize: 17, width: 300, textAlign: 'center'}} /> <FlatList data={[{key: 'item 1'}, {key: 'item 2'}]} renderItem={({item}) => <TouchableHighlight onPress={() => console.log('item press')} underlayColor='#dddddd'> <View style={{height: 40}}> <Text style=...