File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1155,6 +1155,9 @@ export class ComfyApp {
11551155 */
11561156 #addCopyHandler( ) {
11571157 document . addEventListener ( 'copy' , ( e ) => {
1158+ if ( ! ( e . target instanceof Element ) ) {
1159+ return
1160+ }
11581161 if (
11591162 ( e . target instanceof HTMLTextAreaElement &&
11601163 e . target . type === 'textarea' ) ||
@@ -1163,13 +1166,12 @@ export class ComfyApp {
11631166 // Default system copy
11641167 return
11651168 }
1169+ const isTargetInGraph =
1170+ e . target . classList . contains ( 'litegraph' ) ||
1171+ e . target . classList . contains ( 'graph-canvas-container' )
11661172
11671173 // copy nodes and clear clipboard
1168- if (
1169- e . target instanceof Element &&
1170- e . target . classList . contains ( 'litegraph' ) &&
1171- this . canvas . selected_nodes
1172- ) {
1174+ if ( isTargetInGraph && this . canvas . selected_nodes ) {
11731175 this . canvas . copyToClipboard ( )
11741176 e . clipboardData . setData ( 'text' , ' ' ) //clearData doesn't remove images from clipboard
11751177 e . preventDefault ( )
You can’t perform that action at this time.
0 commit comments