Skip to content

Commit 4ff4672

Browse files
committed
fix: handle Vue nodes mode and mouse capture events
- Add early return in interaction methods when Vue nodes mode is active, clearing canvas pointer drag state to prevent stale callbacks - Handle pointerdown/mousedown capture events in node lifecycle by calling handleMouseUp to ensure drag state is properly cleaned up
1 parent 85270ff commit 4ff4672

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

js/interaction/resolution_master_interaction_methods.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ export const interactionMethods = {
280280
},
281281

282282
captureNodePointer(canvas) {
283+
if (this.isVueNodesMode?.()) {
284+
this.clearCanvasPointerDrag();
285+
this._usingCanvasPointerCallbacks = false;
286+
this._capturedPointerCanvas = null;
287+
return;
288+
}
289+
283290
const pointer = this.getCanvasPointer(canvas);
284291
if (pointer && ("onDrag" in pointer || "finally" in pointer)) {
285292
const activeCanvas = canvas
@@ -327,6 +334,13 @@ export const interactionMethods = {
327334
},
328335

329336
releaseNodePointer(canvas) {
337+
if (this.isVueNodesMode?.()) {
338+
this.clearCanvasPointerDrag();
339+
this._usingCanvasPointerCallbacks = false;
340+
this._capturedPointerCanvas = null;
341+
return;
342+
}
343+
330344
const pointer = this.getCanvasPointer(canvas);
331345
if (pointer && ("onDrag" in pointer || "finally" in pointer)) {
332346
this.clearCanvasPointerDrag();

js/node/resolution_master_node_lifecycle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ export const nodeLifecycleMethods = {
508508

509509
try {
510510
return self.withVueCompatWidgetSize(() => {
511+
if (node.capture && (e.type === "pointerdown" || e.type === "mousedown")) {
512+
self.handleMouseUp(e);
513+
}
511514
if (node.capture && (e.type === "pointerup" || e.type === "mouseup" || e.buttons === 0)) {
512515
return self.handleMouseUp(e);
513516
}

0 commit comments

Comments
 (0)