NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

OnPress not working inside Col, List

Open googl3r opened this issue 9 years ago • 5 comments

Hi! I have a List of items and a onPress in Text but onPress is not being triggered and i don't know where the problem come from ?

here is a part of my code

<List dataArray = {this.chunk(this.state.sandwiches,2)} renderRow = {(item) => <Row> <Col style ={this.dynamicStyle(item[0].sandwiches.color)}> { this.state.displayImage && <View> <TouchableOpacity onpress = {_ => alert('hello')}> <Image source = {images[item[0]._key]} style = {this.imageDynamicTransformation(parseFloat(item[0].sandwiches.scale))} resizeMode='contain'/> </TouchableOpacity>

googl3r avatar Jul 20 '17 13:07 googl3r

@googl3r It should be onPress not onpress

shivrajkumar avatar Jul 21 '17 07:07 shivrajkumar

@shivrajkumar even after changing to onPress still doesn't work...i don't know if using componentDidMount have a relation with this

googl3r avatar Jul 21 '17 12:07 googl3r

i don't know why this issue is closed!!

googl3r avatar Jul 21 '17 12:07 googl3r

@googl3r The above code snippet seems to work with onPress. If you still facing this issue. Please post a complete code. So that we can reproduce this error

shivrajkumar avatar Aug 02 '17 10:08 shivrajkumar

hi, i changed my code and added ListItem and its works fine now, thx

googl3r avatar Aug 08 '17 16:08 googl3r