From aa5e47b462b084ec218c1132d21357935f88c564 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 4 Mar 2021 10:45:30 +0000 Subject: [PATCH] Fix copy-to-clipboard action in FireFox --- .../@node-red/editor-client/src/js/ui/clipboard.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js index 6ec719708..d66f2ae89 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js @@ -89,9 +89,12 @@ RED.clipboard = (function() { text: RED._("clipboard.export.copy"), click: function() { if (activeTab === "red-ui-clipboard-dialog-export-tab-clipboard") { - copyText($("#red-ui-clipboard-dialog-export-text").val()); - RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"}); + var flowData = $("#red-ui-clipboard-dialog-export-text").val(); + // Close the dialog first otherwise FireFox won't focus the hidden + // clipboard element in copyText $( this ).dialog( "close" ); + copyText(flowData); + RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"}); } else { var flowToExport = $("#red-ui-clipboard-dialog-export-text").val(); var selectedPath = activeLibraries[activeTab].getSelected();