mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 13:46:12 +02:00
🐛 Fix drag and drop files from browser or file explorer under circumstances
This commit is contained in:
parent
b2b91bfa57
commit
d0ab0bccb9
2 changed files with 10 additions and 1 deletions
|
@ -434,7 +434,15 @@
|
|||
(:id component)
|
||||
(gpt/point final-x final-y))))
|
||||
|
||||
;; Will trigger when the user drags an image from a browser to the viewport
|
||||
;; Will trigger when the user drags an image from a browser to the viewport (firefox and chrome do it a bit different depending on the origin)
|
||||
(dnd/has-type? event "Files")
|
||||
(let [files (dnd/get-files event)
|
||||
params {:file-id (:id file)
|
||||
:position viewport-coord
|
||||
:blobs (seq files)}]
|
||||
(st/emit! (dwm/upload-media-workspace params)))
|
||||
|
||||
;; Will trigger when the user drags an image from a browser to the viewport (firefox and chrome do it a bit different depending on the origin)
|
||||
(dnd/has-type? event "text/uri-list")
|
||||
(let [data (dnd/get-data event "text/uri-list")
|
||||
lines (str/lines data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue