fix(editor): Remove selection box when only one node selected using selection rectangle (#14160)

This commit is contained in:
Alex Grozav
2025-03-25 12:29:14 +02:00
committed by GitHub
parent 30e2df3218
commit acbaec550f

View File

@@ -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"