-
-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PinchGestureHandler and PanGestureHandler not working simultaneously #927
Comments
+1 having same issue |
Having the same issue trying to use Is there a fix for this yet? |
I think this works fine on Android, but not on iOS. |
The issue is present on Using: |
I had a problem with this too, solved it by putting a flex: 1 to all the <Animated.View> |
I just tried this but the view just disappears. |
nah its not working on android, import React from 'react'
} its not even moving, dont know what im doing wrong help plz, |
Any fix yet? |
Could you provide a minimal, working example in form of snack, repo, or code block here? |
I don't know if it helps, but I'm having a similar issue, and I've made a snack that can reproduce it...sort of... https://snack.expo.io/@aproximation/react-native-draggable My actual Android 9 device is behaving the way iPhone 8 in emulation is behaving on that snack: the first drag is jerky but sort of works, and subsequent drags have no animation, and the object just appears at the new destination when you release the mouse. I tried to update the README for that snack to describe what I'm seeing |
I am stuck at same issue |
I am using PanResponder and pinch GestureHandler and faced the same issue and I fixed it by including a condition(gestureState.numberActiveTouches) in onStartShouldSetPanResponder value inside PanResponder.create(),
|
Same here. |
react-native link react-native-gesture-handler path android\app\src\main\java\com\hans_patient\MainActivity.java; import com.facebook.react.ReactActivityDelegate; @OverRide |
I had the same issue where my simultaneous pinch/2-finger pan on an image worked on Android but not iOS, but then I found out it just doesn't work on my older first-generation iPhone SE. It does work on an iPhone XR. So maybe it's an older device thing? Made a simple Snack here: https://snack.expo.io/@amandatusing/simultaneous-pinch-and-zoom-gestures. It's working on a Google Pixel 4a Android version 11 and an iPhone XR iOS 14.6. And it's not just my example. The react-native-gesture-handler demos, like scale and rotate, also don't work on my 1st-gen iPhone SE simultaneously. UPDATE: Although simultaneous pinch and pan wasn't working on my phone when developing locally with Expo, it does work in the built App in Testflight. |
This fixed the problem for me |
react-native-gesture-handler v2.13.4 iOS v17.0 已修复,当我用option+mouse进行缩放,因为两个触点的中心,并没有发生移动,所以drag不会触发,当我用alt+mouse放置一个偏移的点,进行两个点缩放时,拖拽是生效的 |
code is this // -------------------svg拖拽相关逻辑-----------------------
const dragGesture = Gesture.Pan()
.onStart(_e => {})
.onUpdate(e => {
const x = start.value.x + e.translationX;
const y = start.value.y + e.translationY;
offset.value = {
x,
y,
};
})
.onEnd(() => {
start.value = {
x: offset.value.x,
y: offset.value.y,
};
});
// --------------svg缩放相关逻辑----------------
const zoomGesture = Gesture.Pinch()
.onStart(_e => {})
.onUpdate(e => {
const scaleValue = savedScale.value * e.scale;
if (scaleValue > 3 || scaleValue < 1) {
return;
}
scale.value = scaleValue;
})
.onEnd(_e => {
savedScale.value = scale.value;
})
.simultaneousWithExternalGesture(dragGesture);
const composed = Gesture.Simultaneous(dragGesture, zoomGesture);
return (
<GestureDetector gesture={composed}>
<Svg />
</GestureDetector> |
Any update on this? |
I'm not sure whether that's still the case but some time ago there was a problem with simultaneous gestures in general in Expo Go (i.e. simultaneous didn't work at all). If this is still affecting you please open a new issue with a self-contained reproducer that doesn't rely on Expo Go (development build is fine). |
Thanks in advance for the help!
Please let me know if I can provide any extra information!
iOS
35.0.0
Refs:
Handlers:
JSX:
The text was updated successfully, but these errors were encountered: