Skip to content

Commit 0dcf5f6

Browse files
committed
feat: panMinDist parameter
1 parent bfb919b commit 0dcf5f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const CLOSE_DURATION = 200;
1717
export const PAN_GESTURE_TAG = 12431;
1818
const DEFAULT_TRIGGER_WIDTH = 20;
1919
const DEFAULT_TRIGGER_HEIGHT = 20;
20-
const SWIPE_DISTANCE_MINIMUM = 10;
20+
const SWIPE_DISTANCE_MINIMUM = 70;
2121

2222
function transformAnimationValues(values) {
2323
values.translate = { x: values.translateX || 0, y: values.translateY || 0 };
@@ -100,6 +100,7 @@ export class Drawer extends GridLayout {
100100
public backDrop: View;
101101

102102
isPanning = false;
103+
panMinDist = SWIPE_DISTANCE_MINIMUM;
103104
leftSwipeDistance = 30;
104105
rightSwipeDistance = 30;
105106
bottomSwipeDistance = 30;
@@ -158,7 +159,7 @@ export class Drawer extends GridLayout {
158159
const manager = Manager.getInstance();
159160
const gestureHandler = manager.createGestureHandler(HandlerType.PAN, PAN_GESTURE_TAG, {
160161
shouldStartGesture: this.shouldStartGesture.bind(this),
161-
minDist: SWIPE_DISTANCE_MINIMUM,
162+
minDist: this.panMinDist,
162163
});
163164
gestureHandler.on(GestureHandlerTouchEvent, this.onGestureTouch, this);
164165
gestureHandler.on(GestureHandlerStateEvent, this.onGestureState, this);

0 commit comments

Comments
 (0)