From bacf9bce40abb0f78acdea4ff9c4574832344595 Mon Sep 17 00:00:00 2001 From: Sasha Milenkovic Date: Wed, 28 Feb 2024 11:01:13 +0100 Subject: [PATCH] refactor: moves stopPropagation to initDrag function --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 15a20c8..6d29c45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -388,8 +388,6 @@ export function remapFinished() { export function handleDragstart(data: NodeEventData) { if (!(data.e instanceof DragEvent)) return; - data.e.stopPropagation(); - dragstart({ e: data.e, targetData: data.targetData, @@ -413,6 +411,8 @@ export function dragstartClasses( export function initDrag(eventData: NodeDragEventData): DragState { const dragState = setDragState(dragStateProps(eventData.targetData)); + eventData.e.stopPropagation(); + if (eventData.e.dataTransfer) { eventData.e.dataTransfer.dropEffect = "move";