Skip to content

Commit

Permalink
fix(Drag): handle null localPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Williams committed Nov 11, 2019
1 parent c26afbc commit 40f8643
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vx-drag/src/Drag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class Drag extends React.Component<DragProps, DragState> {

this.setState(
({ dx, dy }) => {
const point = localPoint(event);
const point = localPoint(event) || { x: 0, y: 0 };
return {
isDragging: true,
dx: resetOnStart ? 0 : dx,
Expand All @@ -78,7 +78,7 @@ export default class Drag extends React.Component<DragProps, DragState> {

this.setState(
({ x, y, isDragging }) => {
const point = localPoint(event);
const point = localPoint(event) || { x: 0, y: 0 };
return isDragging
? {
isDragging: true,
Expand Down

0 comments on commit 40f8643

Please sign in to comment.