From acbaec550f1ebf560262d6a6492651ebaf72d78d Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Tue, 25 Mar 2025 12:29:14 +0200 Subject: [PATCH] fix(editor): Remove selection box when only one node selected using selection rectangle (#14160) --- .../frontend/editor-ui/src/components/canvas/Canvas.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/frontend/editor-ui/src/components/canvas/Canvas.vue b/packages/frontend/editor-ui/src/components/canvas/Canvas.vue index f538c0082d..d23c09e3fb 100644 --- a/packages/frontend/editor-ui/src/components/canvas/Canvas.vue +++ b/packages/frontend/editor-ui/src/components/canvas/Canvas.vue @@ -139,6 +139,7 @@ const { onNodesInitialized, findNode, viewport, + nodesSelectionActive, onEdgeMouseLeave, onEdgeMouseEnter, onEdgeMouseMove, @@ -357,6 +358,12 @@ function onSelectionDragStop(event: NodeDragEvent) { onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position }))); } +function onSelectionEnd() { + if (selectedNodes.value.length === 1) { + nodesSelectionActive.value = false; + } +} + function onSetNodeActivated(id: string) { props.eventBus.emit('nodes:action', { ids: [id], action: 'update:node:activated' }); emit('update:node:activated', id); @@ -796,6 +803,7 @@ provide(CanvasKey, { @node-drag-stop="onNodeDragStop" @node-click="onNodeClick" @selection-drag-stop="onSelectionDragStop" + @selection-end="onSelectionEnd" @selection-context-menu="onOpenSelectionContextMenu" @dragover="onDragOver" @drop="onDrop"