react-native icon indicating copy to clipboard operation
react-native copied to clipboard

PanResponder doesn’t work correctly with Force Touch

Open dmitrykuznetsovdev opened this issue 10 years ago • 1 comments

Hello, Thank you very much for React Native. But unfortunately I found a following issue. The component has two behaviour at once time - swipe to left/right and touch press.

<TouchableOpacity
  activeOpacity={ 0.75 }
  style={styles.item}
  onPress={this._onPressCard}>

This component is placing at Animated.View element:

<Animated.View style={[styles.card, animatedCardStyles]}
  {...this._panResponder.panHandlers}>
  
   <ExampleCard 
       navigator={this.props.navigator}
 
       item={items}
  
       styleText={styles.cardText}
    
       onPressCard={this._onPressCard}/>

</Animated.View>

It works fine with iPhone 5. But iPhone 6S+ has a force touch feature and when I try to touch a screen harder the event handler is not executing when I assign _panResponder.panHandlers. But everything is working good if I remove it.

How I create panHandlers:

PanResponder.create({
  
  onMoveShouldSetResponderCapture: () => true,
  
  onMoveShouldSetPanResponderCapture: () => true,
  
  onPanResponderGrant: ()=>{},
  
  onPanResponderMove: ()=>{},
  
  onPanResponderRelease: ()=>{}

})

dmitrykuznetsovdev avatar Apr 11 '16 14:04 dmitrykuznetsovdev

https://github.com/facebook/react-native/issues/3082

dmitrykuznetsovdev avatar Apr 11 '16 14:04 dmitrykuznetsovdev