Commit 9562a6b4 authored by comfyanonymous's avatar comfyanonymous
Browse files

Fix a few clipboard issues.

parent d4b2bc09
...@@ -742,7 +742,7 @@ export class ComfyApp { ...@@ -742,7 +742,7 @@ export class ComfyApp {
// copy nodes and clear clipboard // copy nodes and clear clipboard
if (this.canvas.selected_nodes) { if (this.canvas.selected_nodes) {
this.canvas.copyToClipboard(); this.canvas.copyToClipboard();
e.clipboardData.clearData(); e.clipboardData.setData('text', ' '); //clearData doesn't remove images from clipboard
e.preventDefault(); e.preventDefault();
e.stopImmediatePropagation(); e.stopImmediatePropagation();
return false; return false;
...@@ -848,27 +848,14 @@ export class ComfyApp { ...@@ -848,27 +848,14 @@ export class ComfyApp {
// Ctrl+C Copy // Ctrl+C Copy
if ((e.key === 'c') && (e.metaKey || e.ctrlKey)) { if ((e.key === 'c') && (e.metaKey || e.ctrlKey)) {
if (e.shiftKey) { // Trigger onCopy
this.copyToClipboard(true); return true;
e.clipboardData.clearData();
block_default = true;
}
else {
// Trigger onCopy
return true;
}
} }
// Ctrl+V Paste // Ctrl+V Paste
if ((e.key === 'v') && (e.metaKey || e.ctrlKey)) { if ((e.key === 'v' || e.key == 'V') && (e.metaKey || e.ctrlKey)) {
if (e.shiftKey) { // Trigger onPaste
this.pasteFromClipboard(true); return true;
block_default = true;
}
else {
// Trigger onPaste
return true;
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment