diff --git a/CHANGES.md b/CHANGES.md index 1490af28f..2d5e2d016 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -61,6 +61,7 @@ - Update Work-Sans font [#744](https://github.com/penpot/penpot/issues/744) - Fix issue with recent files not showing [Taiga #1493](https://tree.taiga.io/project/penpot/issue/1493) - Fix issue when promoting to owner [Taiga #1494](https://tree.taiga.io/project/penpot/issue/1494) +- Fix cannot click on blocked elements in viewer [Taiga #1430](https://tree.taiga.io/project/penpot/issue/1430) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/shapes/shape.cljs b/frontend/src/app/main/ui/shapes/shape.cljs index 3e18f6ea0..1b145d9c8 100644 --- a/frontend/src/app/main/ui/shapes/shape.cljs +++ b/frontend/src/app/main/ui/shapes/shape.cljs @@ -20,12 +20,13 @@ (mf/defc shape-container {::mf/wrap-props false} [props] - (let [shape (obj/get props "shape") - children (obj/get props "children") - render-id (mf/use-memo #(str (uuid/next))) - filter-id (str "filter_" render-id) - styles (cond-> (obj/new) - (:blocked shape) (obj/set! "pointerEvents" "none")) + (let [shape (obj/get props "shape") + children (obj/get props "children") + pointer-events (obj/get props "pointer-events") + render-id (mf/use-memo #(str (uuid/next))) + filter-id (str "filter_" render-id) + styles (-> (obj/new) + (obj/set! "pointerEvents" pointer-events)) {:keys [x y width height type]} shape frame? (= :frame type) diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index 0383ef143..1996ed140 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -76,7 +76,8 @@ shape (-> (geom/transform-shape shape) (geom/translate-to-frame frame)) opts #js {:shape shape - :frame frame} + :frame frame + :pointer-events (when (:blocked shape) "none")} svg-element? (and (= (:type shape) :svg-raw) (not= :svg (get-in shape [:content :tag])))]