Skip to content

Commit

Permalink
call dragging callback when dragged past threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Jan 23, 2024
1 parent 2073ee1 commit 8dc81b4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ function useDragging(
const onMouseDown = React.useCallback(
(event: React.MouseEvent) => {
setDidDrag(false)
draggingCallback(true)

const mouseDownPoint = windowPoint({ x: event.clientX, y: event.clientY })
const mouseDownCanvasPoint = windowToCanvasCoordinates(
Expand All @@ -492,6 +491,7 @@ function useDragging(
draggedPastThreshold ||= distance(mouseDownPoint, mouseMovePoint) > COMMENT_DRAG_THRESHOLD

if (draggedPastThreshold) {
draggingCallback(true)
dispatch([switchEditorMode(EditorModes.commentMode(null, 'dragging'))])

setDidDrag(true)
Expand Down

0 comments on commit 8dc81b4

Please sign in to comment.