Skip to content

Commit

Permalink
Merge pull request #5 from marcuzgabriel/fix/gesture-handler-bug
Browse files Browse the repository at this point in the history
Fix: Gesture handler bug with worklets
  • Loading branch information
marcuzgabriel authored Jul 27, 2022
2 parents 265eeff + 9230419 commit b85ea07
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 107 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This library provide multiple components but most importantly the BottomSheet. T
| smoothAppearance | object: { waitForContent: boolean, emptyContentHeight?: number } | Ensures a smooth appearance animation of the BottomSheet to eliminate flickering | false
| snapEffectDirection | Animated.SharedValue<string> | Used together with SnapEffect component. It tells the BottomSheet how to react to the effect. Please look in examples for more information | false
| snapPointBottom | number | This prop is required for the BottomSheet to work | true
| springConfig | object { damping?: number; mass?: number; stiffness?: number; overshootClamping?: boolean; restSpeedThreshold?: number; restDisplacementThreshold?: number; } | Overrule default spring config with custom configuration
| springConfig | object { damping?: number; mass?: number; stiffness?: number; overshootClamping?: boolean; restSpeedThreshold?: number; restDisplacementThreshold?: number; } | Overrule default spring config with custom configuration
| testID | string | add testID to the bottomSheet | false
| webBoxShadow | object: { offset: number; opacity: number } | Set a box shadow for web | false
</details>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@marcuzgabriel/reanimated-animation-library",
"author": "Marcuz Gabriel Larsen <marcuzgabriel@gmail.com>",
"version": "1.0.7",
"version": "1.0.8",
"license": "MIT",
"scripts": {
"android": "react-native run-android",
Expand Down Expand Up @@ -102,7 +102,7 @@
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-gesture-handler": "^2.4.2",
"react-native-reanimated": "2.8.0",
"react-native-reanimated": "^2.9.1",
"react-native-redash": "^16.2.4",
"react-native-svg": "12.2.0",
"react-native-svg-web": "^1.0.9",
Expand Down
23 changes: 0 additions & 23 deletions src/types/GestureDetector.d.ts

This file was deleted.

69 changes: 0 additions & 69 deletions src/utils/fixRNGHmocks.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/worklets/gestures/getPanGestureOnBegin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ import type { GestureParams } from '../getGestures';
export const getPanGestureOnBegin =
({ startY, translationY }: GestureParams): (() => void) =>
() => {
'worklet';

startY.value = translationY.value;
};
2 changes: 0 additions & 2 deletions src/worklets/gestures/getPanGestureOnEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const getPanGestureOnEnd =
innerScrollY,
}: GestureParams): ((e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => void) =>
(e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => {
'worklet';

const isPanningDownWithFastRelease = prevDragY.value < dragY.value;
const isPanningDownWithSlowRelease = prevDragY.value <= dragY.value && e.translationY > 0;

Expand Down
2 changes: 0 additions & 2 deletions src/worklets/gestures/getPanGestureOnUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export const getPanGestureOnUpdate =
isHeader?: boolean,
) => void) =>
(e: GestureUpdateEvent<PanGestureHandlerEventPayload>, isHeader?: boolean) => {
'worklet';

if (!isInputFieldFocused.value) {
prevDragY.value = translationY.value;
isPanning.value = prevDragY.value !== e.translationY;
Expand Down
2 changes: 0 additions & 2 deletions src/worklets/getGestures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const getGestures = ({
gestureHandlerParams,
isBottomSheetInactive = false,
}: GetGesturesParams): Record<string, PanGesture | NativeGesture | TapGesture> => {
'worklet';

const isWeb = Platform.OS === 'web';
const isIOS = Platform.OS === 'ios';

Expand Down
9 changes: 5 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7683,11 +7683,12 @@ react-native-gradle-plugin@^0.0.6:
resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.0.6.tgz#b61a9234ad2f61430937911003cddd7e15c72b45"
integrity sha512-eIlgtsmDp1jLC24dRn43hB3kEcZVqx6DUQbR0N1ABXGnMEafm9I3V3dUUeD1vh+Dy5WqijSoEwLNUPLgu5zDMg==

react-native-reanimated@2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.8.0.tgz#93c06ca84d91fb3865110b0857c49a24e316130e"
integrity sha512-kJvf/UWLBMaGCs9X66MKq5zdFMgwx8D0nHnolbHR7s8ZnbLdb7TlQ/yuzIXqn/9wABfnwtNRI3CyaP1aHWMmZg==
react-native-reanimated@^2.9.1:
version "2.9.1"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.9.1.tgz#d9a932e312c13c05b4f919e43ebbf76d996e0bc1"
integrity sha512-309SIhDBwY4F1n6e5Mr5D1uPZm2ESIcmZsGXHUu8hpKX4oIOlZj2MilTk+kHhi05LjChoJkcpfkstotCJmPRPg==
dependencies:
"@babel/plugin-proposal-export-namespace-from" "^7.17.12"
"@babel/plugin-transform-object-assign" "^7.16.7"
"@babel/preset-typescript" "^7.16.7"
"@types/invariant" "^2.2.35"
Expand Down

0 comments on commit b85ea07

Please sign in to comment.