From d49e1f16414063d8ddc414102fa6fd5e313ebdf5 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Wed, 8 Feb 2023 12:19:29 +0100 Subject: [PATCH] :bug: Fix middle button panning can drag guides --- CHANGES.md | 1 + backend/src/app/rpc.clj | 1 - frontend/src/app/main/ui/workspace/viewport/guides.cljs | 9 +++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 42c3513c4..48abb34f7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ ### :bug: Bugs fixed - Fix paste board inside itself [Taiga #4775](https://tree.taiga.io/project/penpot/issue/4775) +- Fix middle button panning can drag guides [Taiga #4266](https://tree.taiga.io/project/penpot/issue/4266) ## 1.17.1 diff --git a/backend/src/app/rpc.clj b/backend/src/app/rpc.clj index d365fd909..9b1f9509a 100644 --- a/backend/src/app/rpc.clj +++ b/backend/src/app/rpc.clj @@ -7,7 +7,6 @@ (ns app.rpc (:require [app.auth.ldap :as-alias ldap] - [app.common.data :as d] [app.common.exceptions :as ex] [app.common.logging :as l] [app.common.spec :as us] diff --git a/frontend/src/app/main/ui/workspace/viewport/guides.cljs b/frontend/src/app/main/ui/workspace/viewport/guides.cljs index 97aa1d805..dd624febd 100644 --- a/frontend/src/app/main/ui/workspace/viewport/guides.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/guides.cljs @@ -69,10 +69,11 @@ on-pointer-down (mf/use-callback (fn [event] - (dom/capture-pointer event) - (mf/set-ref-val! dragging-ref true) - (mf/set-ref-val! start-ref (dom/get-client-position event)) - (mf/set-ref-val! start-pos-ref (get @ms/mouse-position axis)))) + (when (= 0 (.-button event)) + (dom/capture-pointer event) + (mf/set-ref-val! dragging-ref true) + (mf/set-ref-val! start-ref (dom/get-client-position event)) + (mf/set-ref-val! start-pos-ref (get @ms/mouse-position axis))))) on-pointer-up (mf/use-callback