Fix a few clipboard issues.
This commit is contained in:
parent
d4b2bc0964
commit
9562a6b49e
|
@ -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,29 +848,16 @@ 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) {
|
|
||||||
this.copyToClipboard(true);
|
|
||||||
e.clipboardData.clearData();
|
|
||||||
block_default = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Trigger onCopy
|
// Trigger onCopy
|
||||||
return true;
|
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) {
|
|
||||||
this.pasteFromClipboard(true);
|
|
||||||
block_default = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Trigger onPaste
|
// Trigger onPaste
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.graph.change();
|
this.graph.change();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue