Quantcast
Channel: Active questions tagged touchablewithoutfeedback - Stack Overflow
Viewing all articles
Browse latest Browse all 46

onPress handler not being fired over TouchableHighlight on Android

$
0
0

We are experiencing a weird issue. The thing is that when you press the button, for some reason the Highlight to the underlayColor is occurring but the Touchable is not firing the onPress handler.

The onPress handler is ran if you continue pressing the button (like in a long press event)

Any ideas? We are still using an old version of RN which is 0.59.9. I would like to add that on iOS the behavior is the expected.

Update (code):

<TouchableHighlight
    activeOpacity={0.5}
    disabled={disabled}
    delayPressIn={0}
    delayLongPress={0}
    onPress={onPress}
    underlayColor={hexWithOpacity(Palette.Primary, 0.05)}
    style={[
      styles.container,
      buttonStyles(disabled)[variant],
      buttonContainerDimmensions()[size],
      style,
    ]}
    {...props}
  >
    <Text
      style={[
        buttonTextStyles(disabled)[variant],
        buttonFontDimmensions()[size],
      ]}
    >
      {title}
    </Text>
  </TouchableHighlight>

Viewing all articles
Browse latest Browse all 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>