mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 13:12:12 -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:
@@ -130,7 +130,12 @@ export function initDrag(
|
||||
e.target.closest('.lm-lora-expand-button')) {
|
||||
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
|
||||
const lorasData = parseLoraValue(widget.value);
|
||||
const loraData = lorasData.find(l => l.name === name);
|
||||
@@ -255,7 +260,12 @@ export function initHeaderDrag(headerEl, widget, renderFunction) {
|
||||
e.target.closest('input')) {
|
||||
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
|
||||
initialX = e.clientX;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user