From c4332ef32e2cb8c2dfe8386b9632cdd5723a8490 Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Thu, 4 Dec 2025 22:11:52 +0100 Subject: [PATCH 1/4] Fix copy not working when text is selected in dialogs The graph node copy handler was intercepting Ctrl+C/Cmd+C even when the user had text selected in dialogs (like error dialogs). This made it impossible to copy error messages or other text from modal dialogs. Add a hasTextSelection() check to shouldIgnoreCopyPaste() so that when the user has text selected anywhere in the document, the default browser copy behavior is used instead of the graph copy handler. --- src/workbench/eventHelpers.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/workbench/eventHelpers.ts b/src/workbench/eventHelpers.ts index c6ffbac1396..ab494a23df5 100644 --- a/src/workbench/eventHelpers.ts +++ b/src/workbench/eventHelpers.ts @@ -3,6 +3,14 @@ import { useCanvasStore } from '@/renderer/core/canvas/canvasStore' * Utility functions for handling workbench events */ +/** + * Check if there is selected text in the document. + */ +function hasTextSelection(): boolean { + const selection = window.getSelection() + return selection !== null && selection.toString().trim().length > 0 +} + /** * Used by clipboard handlers to determine if copy/paste events should be * intercepted for graph operations vs. allowing default browser behavior @@ -12,7 +20,7 @@ import { useCanvasStore } from '@/renderer/core/canvas/canvasStore' * @returns true if copy paste events will be handled by target */ export function shouldIgnoreCopyPaste(target: EventTarget | null): boolean { - return ( + const isTextInput = target instanceof HTMLTextAreaElement || (target instanceof HTMLInputElement && ![ @@ -26,7 +34,6 @@ export function shouldIgnoreCopyPaste(target: EventTarget | null): boolean { 'reset', 'search', 'submit' - ].includes(target.type)) || - useCanvasStore().linearMode - ) + ].includes(target.type)) + return isTextInput || useCanvasStore().linearMode || hasTextSelection() } From bf0357bd7e2b1bd6b2df207325fb8007820875c3 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 4 Dec 2025 21:16:45 +0000 Subject: [PATCH 2/4] [automated] Apply ESLint and Prettier fixes --- src/scripts/app.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 051b76048e9..9c152d4beaa 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1457,7 +1457,9 @@ export class ComfyApp { }) return } else { - console.error('Invalid workflow structure, trying parameters fallback') + console.error( + 'Invalid workflow structure, trying parameters fallback' + ) this.showErrorOnFileLoad(file) } } catch (err) { From a86b0cfaead1cd65c7f242abd5f929fb97fb948b Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Thu, 4 Dec 2025 22:23:59 +0100 Subject: [PATCH 3/4] reset app.ts --- src/scripts/app.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 9c152d4beaa..051b76048e9 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1457,9 +1457,7 @@ export class ComfyApp { }) return } else { - console.error( - 'Invalid workflow structure, trying parameters fallback' - ) + console.error('Invalid workflow structure, trying parameters fallback') this.showErrorOnFileLoad(file) } } catch (err) { From a88969e0e68b203bd00279391c006a8f218a388e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 4 Dec 2025 21:26:25 +0000 Subject: [PATCH 4/4] [automated] Apply ESLint and Prettier fixes --- src/scripts/app.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 051b76048e9..9c152d4beaa 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1457,7 +1457,9 @@ export class ComfyApp { }) return } else { - console.error('Invalid workflow structure, trying parameters fallback') + console.error( + 'Invalid workflow structure, trying parameters fallback' + ) this.showErrorOnFileLoad(file) } } catch (err) {