mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 02:28:18 -05:00
🐛 Prevent browser dragging of images in some cases
This commit is contained in:
parent
74a168d87e
commit
e713c30785
1 changed files with 8 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
|||
[app.config :as cfg]
|
||||
[app.common.geom.shapes :as geom]
|
||||
[app.main.ui.shapes.attrs :as attrs]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.object :as obj]
|
||||
[app.main.ui.context :as muc]
|
||||
[app.main.data.fetch :as df]
|
||||
|
@ -43,7 +44,11 @@
|
|||
:transform transform
|
||||
:width width
|
||||
:height height
|
||||
:preserveAspectRatio "none"}))]
|
||||
:preserveAspectRatio "none"}))
|
||||
on-drag-start (fn [event]
|
||||
;; Prevent browser dragging of the image
|
||||
(dom/prevent-default event))]
|
||||
|
||||
(if (nil? @data-uri)
|
||||
[:> "rect" (obj/merge!
|
||||
props
|
||||
|
@ -51,4 +56,5 @@
|
|||
:stroke "#000000"})]
|
||||
[:> "image" (obj/merge!
|
||||
props
|
||||
#js {:xlinkHref @data-uri})]))))
|
||||
#js {:xlinkHref @data-uri
|
||||
:onDragStart on-drag-start})]))))
|
||||
|
|
Loading…
Add table
Reference in a new issue