From 3fbfd47089cfdf0735c19a59734c4652cee44ca8 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 3 Mar 2023 15:52:59 +0000 Subject: [PATCH] Show quick-add dialog when draggin wire to empty space --- .../@node-red/editor-client/src/js/ui/view.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 7114b6c47..7e9f0012f 100644 --- 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 @@ -1894,7 +1894,18 @@ RED.view = (function() { }; RED.history.push(historyEvent); RED.nodes.dirty(true); + } else { + // Trigger quick add dialog + d3.event.stopPropagation(); + clearSelection(); + const point = d3.mouse(this); + var clickedGroup = getGroupAt(point[0], point[1]); + if (drag_lines.length > 0) { + clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g) + } + showQuickAddDialog({ position: point, group: clickedGroup }); } + hideDragLines(); } if (lasso) {