From 54d168318342056ae40818e5c0640cae5b8a4a79 Mon Sep 17 00:00:00 2001 From: Idan Entin Date: Wed, 5 Feb 2020 20:43:13 +0200 Subject: [PATCH] fix(selection): Prevent selections while dragging Closes #9 --- src/lib/Draggable.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/Draggable.jsx b/src/lib/Draggable.jsx index bf9556c..b79e904 100644 --- a/src/lib/Draggable.jsx +++ b/src/lib/Draggable.jsx @@ -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; @@ -105,6 +106,7 @@ export function useDraggable({ }; function stopDragging(event) { + event.preventDefault(); setDragging(false); const newDelta = reposition(event); setPrev(newDelta);