Detecting TouchableWithoutFeedback long press release

Viewed 1007

How do I detect when a longPress is released (not by dragging away). onPressOut does say when it's released but it also triggers when finger is dragged away from the button.

  <TouchableWithoutFeedback
    onLongPress={() => this.onLongPress()}
    onPressOut={() => this.onCancel()}
    onPressIn={() => this.onHover()}
    onPress={() => this.onPress()}
  >
2 Answers

How about adding a massive (bigger than the screen) pressRetentionOffset? This should prevent the touch from cancelling unless you release.

<TouchableWithoutFeedback
    ...
    pressRetentionOffset={{ top: 1000, left: 1000, bottom: 1000, right: 1000 }}
>
Related