Repository navigation
Replies: 1 comment
|
Hi @lctuandev, I read through the 2.29.1 orchestrator (GestureHandlerOrchestrator.kt) to see why your two pans block each other. I haven’t been able to run your exact layout, so treat the first part as what the source says rather than a confirmed diagnosis.
If you still see the second pan being cancelled, the usual causes are: one joystick view is a child of the other (or both sit inside a parent view that has its own Pan), so the pointer is shared up the tree. In that case wire them with simultaneousWithExternalGesture: const a = Gesture.Pan(); const b = Gesture.Pan().simultaneousWithExternalGesture(a); (and the reverse on a).
const gesture = Gesture.Manual() This avoids relying on the orchestrator’s cancel rules, and buttons can be hit-tested in the same handler.
If this doesn’t solve it, could you share a minimal Snack/repro showing the view hierarchy of the joysticks and buttons? That’s what determines which of the cases above applies. |
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
We are developing a high-performance mobile control application that requires a multi-axis interface (specifically, two continuous virtual joysticks operating simultaneously) alongside several discrete control buttons on the same screen.
We are facing a critical multi-touch layout issue where continuous pan gestures either mutually exclusive or completely block other native components on the UI thread. We have tried two architectural approaches, but both result in low-level gesture conflicts:
Scenario 1: Single
GestureHandlerRootView(Dual pan gestures cannot activate simultaneously)Gesture.Pan()) are wrapped inside a single, top-levelGestureHandlerRootView.ACTIVE), Finger 2 touching Controller B is completely ignored. The second pan gesture is instantly canceled or blocked.Scenario 2: Multiple
GestureHandlerRootViews(Dual pan gestures work, but lock out all other buttons)GestureHandlerRootView(rendered via a Portal).Pressable,TouchableOpacity) outside of these isolated root views completely ignore touch events or suffer from massive propagation delays.Questions
Pangestures under a singleGestureHandlerRootViewwithout relying on tightly-coupled cross-referencing refs forsimultaneousHandlers? Is there a way to globally allow specific gesture types to run concurrently?GestureHandlerRootViewsapproach, is there a native or JavaScript-level workaround to prevent them from callingrequestDisallowInterceptTouchEventor hijacking multi-touch events destined for default React Native components outside their view tree?Any insights, architectural advice, or native workarounds would be highly appreciated!
Environment:
^2.29.10.83.0All reactions