diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java index 0bf85474793..71e06856e03 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java @@ -69,12 +69,6 @@ public class JSPointerDispatcher { } public void handleMotionEvent(MotionEvent motionEvent, EventDispatcher eventDispatcher) { - - // Ignore if child is handling native gesture - if (mChildHandlingNativeGesture != -1) { - return; - } - boolean supportsHover = PointerEventHelper.supportsHover(motionEvent.getToolType(motionEvent.getActionIndex())); @@ -101,6 +95,9 @@ public class JSPointerDispatcher { // First down pointer if (action == MotionEvent.ACTION_DOWN) { + // Reset mChildHandlingNativeGesture like JSTouchDispatcher does + mChildHandlingNativeGesture = -1; + // Start a "down" coalescing key mDownStartTime = motionEvent.getEventTime(); mTouchEventCoalescingKeyHelper.addCoalescingKey(mDownStartTime); @@ -119,6 +116,12 @@ public class JSPointerDispatcher { return; } + // If the touch was intercepted by a child, we've already sent a cancel event to JS for this + // gesture, so we shouldn't send any more pointer events related to it. + if (mChildHandlingNativeGesture != -1) { + return; + } + // New pointer goes down, this can only happen after ACTION_DOWN is sent for the first pointer if (action == MotionEvent.ACTION_POINTER_DOWN) { mTouchEventCoalescingKeyHelper.incrementCoalescingKey(mDownStartTime);