From e984c9868014ae02987e712bb4fc09ff8e28bb1a Mon Sep 17 00:00:00 2001 From: newbyvector Date: Thu, 7 Sep 2023 14:51:41 +0800 Subject: [PATCH] fix: trigger click event when click edge with vertices tool --- packages/x6/src/registry/tool/vertices.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/x6/src/registry/tool/vertices.ts b/packages/x6/src/registry/tool/vertices.ts index 1c142f36fc6..4b4c0d38f7a 100644 --- a/packages/x6/src/registry/tool/vertices.ts +++ b/packages/x6/src/registry/tool/vertices.ts @@ -145,6 +145,7 @@ export class Vertices extends ToolsView.ToolItem { edgeView.cell.startBatch('move-vertex', { ui: true, toolId: this.cid }) if (!this.options.stopPropagation) { const { e: evt, x, y } = this.getMouseEventArgs(e) + this.eventData(evt, { start: { x, y } }) edgeView.notifyMouseDown(evt, x, y) } } @@ -202,6 +203,13 @@ export class Vertices extends ToolsView.ToolItem { if (!this.options.stopPropagation) { edgeView.notifyMouseUp(evt, x, y) + const { start } = this.eventData(evt) + if (start) { + const { x: startX, y: startY } = start + if (startX === x && startY === y) { + edgeView.onClick(evt as unknown as Dom.ClickEvent, x, y) + } + } } edgeView.checkMouseleave(evt)