1

I just updated a react native project from rn 0.61.5 to rn 0.62.2. Things are mostly fine except that the onPress on my <TouchableOpacity> doesn't respond if I have delayPressIn, delayPressOut, or delayLongPress in that same touchable opacity.

Getting rid of them is not ideal because I was using them to avoid triggering onPress for touchable opacities in a flatlist on scroll.

Looking in the most recent documentation for react native delayPressIn, delayPressOut, and delayLongPress are no longer listed on the documentation for touchable opacity or touchable hightlight. They are listed in the documentation for TouchableWithoutFeedback, but this doesn't fit my needs.

This is an issue regardless of whether I'm using just one, or more than one in combination.

For example:

<TouchableOpacity
//  delayPressIn={5}
//  delayPressOut={5}
//  delayLongPress={5}
    accessible={!this.state.menuOpen}
    onPress={() => {
        this.props.navigation.navigate('OneAlertScreen', {userId: userId})
    }} 
    title="Alert Details"
    key={item.alertNumber}
    style={styles.myCardStyle}
>
 
  ..........stuff inside my touchable opacity

</TouchableOpacity>

works, but if I uncomment any of those it won't. It doesn't throw an error - just fails silently.

Has anyone found a way around this? Thanks

Paul Rumkin
  • 6,737
  • 2
  • 25
  • 35
Charlotte_Anne
  • 344
  • 5
  • 17

0 Answers0