Skip to content

Commit 756b4c5

Browse files
authored
Merge branch 'main' into @akwasniewski/remove-begin-from-sm
2 parents 972b6b8 + 0e91d90 commit 756b4c5

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

packages/react-native-gesture-handler/apple/Handlers/RNTapHandler.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ - (void)interactionsCancelled:(NSSet *)touches withEvent:(UIEvent *)event
148148
{
149149
[_gestureHandler.pointerTracker touchesCancelled:touches withEvent:event];
150150
self.state = UIGestureRecognizerStateCancelled;
151+
152+
[self triggerAction];
151153
}
152154

153155
#if TARGET_OS_OSX

packages/react-native-gesture-handler/src/v3/components/GestureButtons.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const BaseButton = (props: BaseButtonProps) => {
3939
if (onLongPress) {
4040
longPressTimeout.current = setTimeout(wrappedLongPress, delayLongPress);
4141
}
42+
43+
props.onBegin?.(e);
4244
}
4345
};
4446

@@ -50,27 +52,35 @@ export const BaseButton = (props: BaseButtonProps) => {
5052
if (onLongPress) {
5153
longPressTimeout.current = setTimeout(wrappedLongPress, delayLongPress);
5254
}
55+
56+
props.onBegin?.(e);
5357
}
5458

5559
if (!e.pointerInside && longPressTimeout.current !== undefined) {
5660
clearTimeout(longPressTimeout.current);
5761
longPressTimeout.current = undefined;
5862
}
63+
64+
props.onActivate?.(e);
5965
};
6066

61-
const onDeactivate = (e: CallbackEventType, success: boolean) => {
67+
const onDeactivate = (e: CallbackEventType, didSucceed: boolean) => {
6268
onActiveStateChange?.(false);
6369

64-
if (success && !longPressDetected.current) {
70+
if (didSucceed && !longPressDetected.current) {
6571
onPress?.(e.pointerInside);
6672
}
73+
74+
props.onDeactivate?.(e, didSucceed);
6775
};
6876

69-
const onFinalize = (_e: CallbackEventType) => {
77+
const onFinalize = (e: CallbackEventType, didSucceed: boolean) => {
7078
if (longPressTimeout.current !== undefined) {
7179
clearTimeout(longPressTimeout.current);
7280
longPressTimeout.current = undefined;
7381
}
82+
83+
props.onFinalize?.(e, didSucceed);
7484
};
7585

7686
return (

packages/react-native-gesture-handler/src/v3/hooks/gestures/native/NativeTypes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
BaseDiscreteGestureConfig,
2+
BaseGestureConfig,
33
ExcludeInternalConfigProps,
44
GestureEvent,
55
SingleGesture,
@@ -33,7 +33,7 @@ export type NativeHandlerData = {
3333
export type NativeGestureProperties =
3434
WithSharedValue<NativeGestureNativeProperties>;
3535

36-
export type NativeGestureInternalConfig = BaseDiscreteGestureConfig<
36+
export type NativeGestureInternalConfig = BaseGestureConfig<
3737
NativeGestureProperties,
3838
NativeHandlerData
3939
>;

0 commit comments

Comments
 (0)