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 b9db8fafb..f6a613f5f 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 @@ -946,28 +946,25 @@ RED.clipboard = (function() { if (truncated) { msg += "_truncated"; } - $("#red-ui-clipboard-hidden").val(value).focus().select(); - var result = document.execCommand("copy"); - if (result && element) { - var popover = RED.popover.create({ - target: element, - direction: 'left', - size: 'small', - content: RED._(msg) - }); - setTimeout(function() { - popover.close(); - },1000); - popover.open(); - } - $("#red-ui-clipboard-hidden").val(""); - if (currentFocus) { - $(currentFocus).focus(); - } - return result; + navigator.clipboard.writeText(value).then(function () { + if (element) { + var popover = RED.popover.create({ + target: element, + direction: 'left', + size: 'small', + content: RED._(msg) + }); + setTimeout(function() { + popover.close(); + },1000); + popover.open(); + } + if (currentFocus) { + $(currentFocus).focus(); + } + }).catch(err => { console.error("Failed to copy:",err) }); } - function importNodes(nodesStr,addFlow) { var newNodes = nodesStr; if (typeof nodesStr === 'string') { @@ -1242,8 +1239,6 @@ RED.clipboard = (function() { init: function() { setupDialogs(); - $('