@@ -69,12 +69,6 @@ public void onChildEndedNativeGesture() {
69
69
}
70
70
71
71
public void handleMotionEvent (MotionEvent motionEvent , EventDispatcher eventDispatcher ) {
72
-
73
- // Ignore if child is handling native gesture
74
- if (mChildHandlingNativeGesture != -1 ) {
75
- return ;
76
- }
77
-
78
72
boolean supportsHover =
79
73
PointerEventHelper .supportsHover (motionEvent .getToolType (motionEvent .getActionIndex ()));
80
74
@@ -101,6 +95,9 @@ public void handleMotionEvent(MotionEvent motionEvent, EventDispatcher eventDisp
101
95
// First down pointer
102
96
if (action == MotionEvent .ACTION_DOWN ) {
103
97
98
+ // Reset mChildHandlingNativeGesture like JSTouchDispatcher does
99
+ mChildHandlingNativeGesture = -1 ;
100
+
104
101
// Start a "down" coalescing key
105
102
mDownStartTime = motionEvent .getEventTime ();
106
103
mTouchEventCoalescingKeyHelper .addCoalescingKey (mDownStartTime );
@@ -119,6 +116,12 @@ public void handleMotionEvent(MotionEvent motionEvent, EventDispatcher eventDisp
119
116
return ;
120
117
}
121
118
119
+ // If the touch was intercepted by a child, we've already sent a cancel event to JS for this
120
+ // gesture, so we shouldn't send any more pointer events related to it.
121
+ if (mChildHandlingNativeGesture != -1 ) {
122
+ return ;
123
+ }
124
+
122
125
// New pointer goes down, this can only happen after ACTION_DOWN is sent for the first pointer
123
126
if (action == MotionEvent .ACTION_POINTER_DOWN ) {
124
127
mTouchEventCoalescingKeyHelper .incrementCoalescingKey (mDownStartTime );
0 commit comments