From d9900d8e4ce879700362be77717c47369731e211 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 3 Sep 2020 13:12:08 +0100 Subject: [PATCH] Fix copy/paste of node into active group Fixes #2686 --- .../@node-red/editor-client/src/js/ui/view.js | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index d488ed201..9474f2d16 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -1678,7 +1678,7 @@ RED.view = (function() { } } - if (ns.length > 0) { + if (ns.length > 0 && mouse_mode == RED.state.MOVING_ACTIVE) { historyEvent = {t:"move",nodes:ns,dirty:RED.nodes.dirty()}; if (activeSpliceLink) { // TODO: DRY - droppable/nodeMouseDown/canvasMouseUp @@ -2354,6 +2354,10 @@ RED.view = (function() { mousedown_port_type = null; activeSpliceLink = null; spliceActive = false; + if (activeHoverGroup) { + activeHoverGroup.hovered = false; + activeHoverGroup = null; + } d3.select(".red-ui-flow-link-splice").classed("red-ui-flow-link-splice",false); if (spliceTimer) { clearTimeout(spliceTimer); @@ -2869,7 +2873,7 @@ RED.view = (function() { //RED.touch.radialMenu.show(d3.select(this),pos); if (mouse_mode == RED.state.IMPORT_DRAGGING) { RED.keyboard.remove("escape"); - + var historyEvent = RED.history.peek(); if (activeSpliceLink) { // TODO: DRY - droppable/nodeMouseDown/canvasMouseUp var spliceLink = d3.select(activeSpliceLink).data()[0]; @@ -2886,12 +2890,27 @@ RED.view = (function() { }; RED.nodes.addLink(link1); RED.nodes.addLink(link2); - var historyEvent = RED.history.peek(); + historyEvent.links = [link1,link2]; historyEvent.removedLinks = [spliceLink]; updateActiveNodes(); } + if (activeHoverGroup) { + for (var j=0;j