From fad43ad003423b7216ba003295da812c86f350ff Mon Sep 17 00:00:00 2001 From: Will Miao Date: Sat, 24 Jan 2026 22:26:17 +0800 Subject: [PATCH] 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. --- web/comfyui/loras_widget_events.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/web/comfyui/loras_widget_events.js b/web/comfyui/loras_widget_events.js index 47a459a8..63f30c08 100644 --- a/web/comfyui/loras_widget_events.js +++ b/web/comfyui/loras_widget_events.js @@ -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;