0
Fork 0
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:
Andrés Moya 2021-03-15 14:52:48 +01:00 committed by Andrey Antukh
parent 797ba3ef9b
commit 84b7a2de0b
2 changed files with 10 additions and 1 deletions

View file

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

View file

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