Commit 5ac96897 authored by comfyanonymous's avatar comfyanonymous
Browse files

Images can now be uploaded by dragging from another window in chromium.

parent a5599ed4
...@@ -433,7 +433,7 @@ export const ComfyWidgets = { ...@@ -433,7 +433,7 @@ export const ComfyWidgets = {
// Add handler to check if an image is being dragged over our node // Add handler to check if an image is being dragged over our node
node.onDragOver = function (e) { node.onDragOver = function (e) {
if (e.dataTransfer && e.dataTransfer.items) { if (e.dataTransfer && e.dataTransfer.items) {
const image = [...e.dataTransfer.items].find((f) => f.kind === "file" && f.type.startsWith("image/")); const image = [...e.dataTransfer.items].find((f) => f.kind === "file");
return !!image; return !!image;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment