From 40f86438e169180464a787673280cbb5491bf218 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Mon, 21 Oct 2019 21:20:13 -0700 Subject: [PATCH] fix(Drag): handle null localPoint --- packages/vx-drag/src/Drag.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vx-drag/src/Drag.tsx b/packages/vx-drag/src/Drag.tsx index 5fadd71fa..fac8079cf 100644 --- a/packages/vx-drag/src/Drag.tsx +++ b/packages/vx-drag/src/Drag.tsx @@ -56,7 +56,7 @@ export default class Drag extends React.Component { this.setState( ({ dx, dy }) => { - const point = localPoint(event); + const point = localPoint(event) || { x: 0, y: 0 }; return { isDragging: true, dx: resetOnStart ? 0 : dx, @@ -78,7 +78,7 @@ export default class Drag extends React.Component { this.setState( ({ x, y, isDragging }) => { - const point = localPoint(event); + const point = localPoint(event) || { x: 0, y: 0 }; return isDragging ? { isDragging: true,