0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-08 08:09:14 -05:00

🐛 Fix cannot click on blocked elements in viewer

This commit is contained in:
alonso.torres 2021-03-29 11:56:15 +02:00 committed by Andrey Antukh
parent 2500486186
commit 213a8c69fb
3 changed files with 10 additions and 7 deletions

View file

@ -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

View file

@ -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)

View file

@ -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])))]