mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix(canvas-core): to avoid triggering drag container and it's children at the same time with a single event
This commit is contained in:
parent
561c7c620c
commit
4fd6ac19ea
@ -126,10 +126,12 @@ export class WorkflowDragService {
|
|||||||
if (
|
if (
|
||||||
selectedNodes.length === 0 ||
|
selectedNodes.length === 0 ||
|
||||||
this.playgroundConfig.readonly ||
|
this.playgroundConfig.readonly ||
|
||||||
this.playgroundConfig.disabled
|
this.playgroundConfig.disabled ||
|
||||||
|
this.isDragging
|
||||||
) {
|
) {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
|
this.isDragging = true;
|
||||||
const sameParent = this.childrenOfContainer(selectedNodes);
|
const sameParent = this.childrenOfContainer(selectedNodes);
|
||||||
if (sameParent && sameParent.flowNodeType !== FlowNodeBaseType.ROOT) {
|
if (sameParent && sameParent.flowNodeType !== FlowNodeBaseType.ROOT) {
|
||||||
selectedNodes = [sameParent];
|
selectedNodes = [sameParent];
|
||||||
@ -146,7 +148,6 @@ export class WorkflowDragService {
|
|||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
const dragger = new PlaygroundDrag({
|
const dragger = new PlaygroundDrag({
|
||||||
onDragStart: (dragEvent) => {
|
onDragStart: (dragEvent) => {
|
||||||
this.isDragging = true;
|
|
||||||
this._nodesDragEmitter.fire({
|
this._nodesDragEmitter.fire({
|
||||||
type: 'onDragStart',
|
type: 'onDragStart',
|
||||||
nodes: selectedNodes,
|
nodes: selectedNodes,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user