From ffdf13d1562864a52899eee950004859f49d12dd Mon Sep 17 00:00:00 2001 From: ko1234 Date: Fri, 26 Sep 2025 14:16:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20draggable=20?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E7=9A=84=20mousedown=20=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=B6=81=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/directives/draggable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/directives/draggable.js b/src/directives/draggable.js index 726d156..66522e9 100644 --- a/src/directives/draggable.js +++ b/src/directives/draggable.js @@ -4,13 +4,14 @@ const moveModal = (elmnt) => { pos2 = 0, pos3 = 0, pos4 = 0; - document.body.addEventListener("mousedown", dragMouseDown, { + elmnt.addEventListener("mousedown", dragMouseDown, { passive: false, }); function dragMouseDown(e) { console.log("dragMouseDown", e); e = e || window.event; + if (e.button !== 0) return; e.preventDefault(); // get the mouse cursor position at startup: pos3 = e.clientX;