Skip to content

Commit

Permalink
fix: fix DragndropPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mivui authored Jul 19, 2024
1 parent 7c68899 commit 8363f03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/g-plugin-dragndrop/src/DragndropPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class DragndropPlugin implements RenderingPlugin {
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/dragstart_event
event.type = 'dragstart';

draggableEventTarget.dispatchEvent(event);
target.dispatchEvent(event);
dragstartTriggered = true;
}

Expand Down Expand Up @@ -102,14 +102,14 @@ export class DragndropPlugin implements RenderingPlugin {
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/dragleave_event
event.type = 'dragleave';
event.target = currentDroppable;
currentDroppable.dispatchEvent(event);
target.dispatchEvent(event);
}

if (droppableBelow) {
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/dragleave_event
event.type = 'dragenter';
event.target = droppableBelow;
droppableBelow.dispatchEvent(event);
target.dispatchEvent(event);
}

currentDroppable = droppableBelow;
Expand All @@ -118,7 +118,7 @@ export class DragndropPlugin implements RenderingPlugin {
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/dragover_event
event.type = 'dragover';
event.target = currentDroppable;
currentDroppable.dispatchEvent(event);
target.dispatchEvent(event);
}
}
}
Expand Down Expand Up @@ -146,12 +146,12 @@ export class DragndropPlugin implements RenderingPlugin {
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/drop_event
event.type = 'drop';
event.target = currentDroppable;
currentDroppable.dispatchEvent(event);
target.dispatchEvent(event);
}

// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/dragend_event
event.type = 'dragend';
draggableEventTarget.dispatchEvent(event);
target.dispatchEvent(event);

dragstartTriggered = false;
}
Expand Down

0 comments on commit 8363f03

Please sign in to comment.