mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
## Summary - Allow default browser copy (Ctrl+C / Cmd+C) when text is selected anywhere in the document - Previously, the graph node copy handler intercepted copy events even in dialogs ## Problem Users could not copy error messages from the PromptExecutionError dialog or other modal dialogs. When pressing Ctrl+C with text selected in a dialog, the graph copy handler would intercept the event and prevent the default browser copy behavior. ## Solution Add a `hasTextSelection()` check to `shouldIgnoreCopyPaste()`. When the user has any text selected in the document, the function returns `true`, allowing the default browser copy to proceed. ## Test plan - [ ] Open an error dialog (trigger a workflow error) - [ ] Click "Show Report" to expand error details - [ ] Select some text in the dialog - [ ] Press Ctrl+C (or Cmd+C on Mac) - [ ] Paste elsewhere to verify the text was copied - [ ] Verify graph node copy still works when no text is selected https://github.com/user-attachments/assets/30a0c501-95ee-4148-b321-3d60339a41c5 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7166-Fix-copy-not-working-when-text-is-selected-in-dialogs-2bf6d73d36508182a240fd3153cb6969) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>