From 9562a6b49e63e63a16f3e45ff4965f72385f51fa Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 10 Sep 2023 11:19:31 -0400 Subject: [PATCH] Fix a few clipboard issues. --- web/scripts/app.js | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/web/scripts/app.js b/web/scripts/app.js index 7ef2fc4e..9db4e923 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -742,7 +742,7 @@ export class ComfyApp { // copy nodes and clear clipboard if (this.canvas.selected_nodes) { this.canvas.copyToClipboard(); - e.clipboardData.clearData(); + e.clipboardData.setData('text', ' '); //clearData doesn't remove images from clipboard e.preventDefault(); e.stopImmediatePropagation(); return false; @@ -848,27 +848,14 @@ export class ComfyApp { // Ctrl+C Copy if ((e.key === 'c') && (e.metaKey || e.ctrlKey)) { - if (e.shiftKey) { - this.copyToClipboard(true); - e.clipboardData.clearData(); - block_default = true; - } - else { - // Trigger onCopy - return true; - } + // Trigger onCopy + return true; } // Ctrl+V Paste - if ((e.key === 'v') && (e.metaKey || e.ctrlKey)) { - if (e.shiftKey) { - this.pasteFromClipboard(true); - block_default = true; - } - else { - // Trigger onPaste - return true; - } + if ((e.key === 'v' || e.key == 'V') && (e.metaKey || e.ctrlKey)) { + // Trigger onPaste + return true; } }