1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Fix a few clipboard issues.

This commit is contained in:
comfyanonymous
2023-09-10 11:19:31 -04:00
parent d4b2bc0964
commit 9562a6b49e

View File

@@ -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;
}
}