mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 03:13:30 +00:00
Add dragleave handler to remove stuck highlight
This commit is contained in:
parent
f2a6cff466
commit
019bd519cb
@ -289,13 +289,21 @@ class ComfyApp {
|
|||||||
this.dragOverNode = null;
|
this.dragOverNode = null;
|
||||||
// Node handles file drop, we dont use the built in onDropFile handler as its buggy
|
// Node handles file drop, we dont use the built in onDropFile handler as its buggy
|
||||||
// If you drag multiple files it will call it multiple times with the same file
|
// If you drag multiple files it will call it multiple times with the same file
|
||||||
if (n && n.onDragDrop && await n.onDragDrop(event)) {
|
if (n && n.onDragDrop && (await n.onDragDrop(event))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.handleFile(event.dataTransfer.files[0]);
|
await this.handleFile(event.dataTransfer.files[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Always clear over node on drag leave
|
||||||
|
this.canvasEl.addEventListener("dragleave", async () => {
|
||||||
|
if (this.dragOverNode) {
|
||||||
|
this.dragOverNode = null;
|
||||||
|
this.graph.setDirtyCanvas(false, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Add handler for dropping onto a specific node
|
// Add handler for dropping onto a specific node
|
||||||
this.canvasEl.addEventListener(
|
this.canvasEl.addEventListener(
|
||||||
"dragover",
|
"dragover",
|
||||||
|
Loading…
Reference in New Issue
Block a user