mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-21 13:03:18 +00:00
## Summary handleDrop checked `handled === true` to gate stopPropagation, but onDragDrop from useNodeDragAndDrop is async and always returns a Promise, so the check never matched. The drop then bubbled to the document handler in app.ts and spawned a new LoadImage node in addition to the one that accepted the drop. Updated onDragDrop to take an optional claimEvent flag — when true, it calls preventDefault()/stopPropagation() synchronously inside the handler, only after the sync acceptance check passes (valid files / same-origin URI), and before any await. The Vue node now just calls await node.onDragDrop(event, true). Rejected payloads (cross-origin URI, files filtered out, no valid files) skip the claim and bubble to the document fallback as before. The remaining edge case is async URI fetch failures, which we can't sync-detect without speculatively claiming. ## Screenshots (if applicable) before https://github.com/user-attachments/assets/d79a5101-370b-4873-8365-5f9ce188731b after https://github.com/user-attachments/assets/8b787474-eab9-4060-8146-c4d8bb24ff9f ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11541-fix-stop-duplicate-node-creation-when-dropping-image-on-Vue-nodes-34a6d73d36508113b153e31768602933) by [Unito](https://www.unito.io)