mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
✨ Disable drag enter/leave animation in webkit browsers
This commit is contained in:
parent
797ba3ef9b
commit
84b7a2de0b
2 changed files with 10 additions and 1 deletions
|
@ -294,7 +294,8 @@
|
|||
(fn [e]
|
||||
(when (dnd/has-type? e "penpot/files")
|
||||
(dom/prevent-default e)
|
||||
(when-not (dnd/from-child? e)
|
||||
(when-not (or (dnd/from-child? e)
|
||||
(dnd/broken-event? e))
|
||||
(when (not= selected-project project-id)
|
||||
(reset! dragging? true))))))
|
||||
|
||||
|
|
|
@ -98,6 +98,14 @@
|
|||
related (.-relatedTarget e)]
|
||||
(.contains target related)))
|
||||
|
||||
(defn broken-event?
|
||||
[e]
|
||||
;; WebKit browsers (Safari & Epiphany) do not send the relatedEvent
|
||||
;; property (https://bugs.webkit.org/show_bug.cgi?id=66547) so
|
||||
;; there is no decent way of discriminating redundant enter/leave
|
||||
;; events.
|
||||
(nil? (.-relatedTarget e)))
|
||||
|
||||
(defn get-data
|
||||
([e]
|
||||
(get-data e "penpot/data"))
|
||||
|
|
Loading…
Add table
Reference in a new issue