From 11f54f51eaadea1ac6618648cc41c9798f4253ca Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 19 Apr 2020 13:02:13 +0200 Subject: [PATCH] :bug: Fix context menu handling on image shapes. --- frontend/src/uxbox/main/ui/shapes/image.cljs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/uxbox/main/ui/shapes/image.cljs b/frontend/src/uxbox/main/ui/shapes/image.cljs index 18a523086d..ded7d45e14 100644 --- a/frontend/src/uxbox/main/ui/shapes/image.cljs +++ b/frontend/src/uxbox/main/ui/shapes/image.cljs @@ -25,9 +25,17 @@ [{:keys [shape frame] :as props}] (let [selected (mf/deref refs/selected-shapes) selected? (contains? selected (:id shape)) - on-mouse-down #(common/on-mouse-down % shape)] + on-mouse-down (mf/use-callback + (mf/deps shape) + #(common/on-mouse-down % shape)) + + on-context-menu (mf/use-callback + (mf/deps shape) + #(common/on-context-menu % shape))] + [:g.shape {:class (when selected? "selected") - :on-mouse-down on-mouse-down} + :on-mouse-down on-mouse-down + :on-context-menu on-context-menu} [:& image-shape {:shape (geom/transform-shape frame shape)}]])) ;; --- Image Shape