Skip to content

Commit 0f5d597

Browse files
committed
Add default values to hover
1 parent e7f0054 commit 0f5d597

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HandlerData, SingleGestureName } from '../../../types';
1+
import { GestureEvent, HandlerData, SingleGestureName } from '../../../types';
22
import { useGesture } from '../../useGesture';
33
import {
44
useClonedAndRemappedConfig,
@@ -25,10 +25,18 @@ function diffCalculator(
2525
};
2626
}
2727

28+
function fillInDefaultValues(event: GestureEvent<HoverExtendedHandlerData>) {
29+
'worklet';
30+
31+
event.changeX = 0;
32+
event.changeY = 0;
33+
}
34+
2835
function transformHoverProps(
2936
config: HoverGestureConfig & HoverGestureInternalConfig
3037
) {
3138
config.changeEventCalculator = getChangeEventCalculator(diffCalculator);
39+
config.fillInDefaultValues = fillInDefaultValues;
3240

3341
return config;
3442
}

0 commit comments

Comments
 (0)