Skip to content

Commit 42e84b4

Browse files
committed
old api compatibility
1 parent af663c8 commit 42e84b4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/react-native-gesture-handler/src/RNGestureHandlerModule.web.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export default {
8585
},
8686
dropGestureHandler(handlerTag: number) {
8787
if (shouldPreventDrop) {
88+
shouldPreventDrop = false;
8889
return;
8990
}
9091

packages/react-native-gesture-handler/src/web/handlers/GestureHandler.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,21 @@ export default abstract class GestureHandler implements IGestureHandler {
356356
return;
357357
}
358358

359-
const { onGestureHandlerTouchEvent }: PropsRef = this.propsRef
360-
.current as PropsRef;
359+
const { onGestureHandlerEvent, onGestureHandlerTouchEvent }: PropsRef = this
360+
.propsRef.current as PropsRef;
361361

362362
const touchEvent: ResultTouchEvent | undefined =
363363
this.transformTouchEvent(event);
364364

365365
if (touchEvent) {
366-
invokeNullableMethod(onGestureHandlerTouchEvent, touchEvent);
366+
if (
367+
this.actionType === ActionType.NATIVE_DETECTOR ||
368+
this.actionType === ActionType.NATIVE_DETECTOR_ANIMATED_EVENT
369+
) {
370+
invokeNullableMethod(onGestureHandlerTouchEvent, touchEvent);
371+
} else {
372+
invokeNullableMethod(onGestureHandlerEvent, touchEvent);
373+
}
367374
}
368375
}
369376

0 commit comments

Comments
 (0)