mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 04:11:41 +02:00
🐛 Fix drag-select when renaming layer text
This commit is contained in:
parent
0f6ce233bd
commit
cd7ad03cf0
3 changed files with 23 additions and 19 deletions
|
@ -14,6 +14,7 @@
|
|||
[app.common.spec :as us]
|
||||
[app.main.data.shortcuts :refer [bind-shortcuts]]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.object :as obj]
|
||||
[app.util.dom.dnd :as dnd]
|
||||
[app.util.logging :as log]
|
||||
[app.util.timers :as ts]
|
||||
|
@ -97,7 +98,7 @@
|
|||
;; things go weird.
|
||||
|
||||
(defn use-sortable
|
||||
[& {:keys [data-type data on-drop on-drag on-hold detect-center?] :as opts}]
|
||||
[& {:keys [data-type data on-drop on-drag on-hold disabled detect-center?] :as opts}]
|
||||
(let [ref (mf/use-ref)
|
||||
state (mf/use-state {:over nil
|
||||
:timer nil
|
||||
|
@ -125,13 +126,16 @@
|
|||
|
||||
on-drag-start
|
||||
(fn [event]
|
||||
(dom/stop-propagation event)
|
||||
;; (dnd/trace event data "drag-start")
|
||||
(dnd/set-data! event data-type data)
|
||||
(dnd/set-drag-image! event (invisible-image))
|
||||
(dnd/set-allowed-effect! event "move")
|
||||
(when (fn? on-drag)
|
||||
(on-drag data)))
|
||||
(if disabled
|
||||
(dom/prevent-default event)
|
||||
(let [target (dom/get-target event)]
|
||||
(dom/stop-propagation event)
|
||||
;; (dnd/trace event data "drag-start")
|
||||
(dnd/set-data! event data-type data)
|
||||
(dnd/set-drag-image! event (invisible-image))
|
||||
(dnd/set-allowed-effect! event "move")
|
||||
(when (fn? on-drag)
|
||||
(on-drag data)))))
|
||||
|
||||
on-drag-enter
|
||||
(fn [event]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue