Skip to content

Commit

Permalink
fix(selection): Prevent selections while dragging
Browse files Browse the repository at this point in the history
Closes #9
  • Loading branch information
idanen committed Feb 5, 2020
1 parent 2ea5cb8 commit 54d1683
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/Draggable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function useDraggable({
};

function startDragging(event) {
event.preventDefault();
setDragging(true);
const source = (event.touches && event.touches[0]) || event;
const { clientX, clientY } = source;
Expand Down Expand Up @@ -105,6 +106,7 @@ export function useDraggable({
};

function stopDragging(event) {
event.preventDefault();
setDragging(false);
const newDelta = reposition(event);
setPrev(newDelta);
Expand Down

0 comments on commit 54d1683

Please sign in to comment.