mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(ui): restrict drag events to left mouse button only, fixes #777
Add button condition checks in initDrag and initHeaderDrag functions to ensure only left mouse button (button 0) triggers drag interactions. This prevents conflicts with middle button canvas dragging and right button context menu actions, improving user experience and interaction clarity.
This commit is contained in:
@@ -131,6 +131,11 @@ export function initDrag(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only handle left mouse button (allow middle button for canvas drag, right button for context menu)
|
||||||
|
if (e.button !== 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Store initial values
|
// Store initial values
|
||||||
const lorasData = parseLoraValue(widget.value);
|
const lorasData = parseLoraValue(widget.value);
|
||||||
const loraData = lorasData.find(l => l.name === name);
|
const loraData = lorasData.find(l => l.name === name);
|
||||||
@@ -256,6 +261,11 @@ export function initHeaderDrag(headerEl, widget, renderFunction) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only handle left mouse button (allow middle button for canvas drag, right button for context menu)
|
||||||
|
if (e.button !== 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Store initial X position
|
// Store initial X position
|
||||||
initialX = e.clientX;
|
initialX = e.clientX;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user