react-native
react-native copied to clipboard
PanResponder doesn’t work correctly with Force Touch
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: ()=>{}
})
https://github.com/facebook/react-native/issues/3082