mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -05:00
🐛 Fix layer drag enabled on chrome when is readonly
This commit is contained in:
parent
b45a0a979b
commit
d8bb62c498
2 changed files with 21 additions and 13 deletions
|
@ -110,7 +110,7 @@
|
|||
|
||||
on-drag-start
|
||||
(fn [event]
|
||||
(if disabled
|
||||
(if (or disabled (not draggable?))
|
||||
(dom/prevent-default event)
|
||||
(do
|
||||
(dom/stop-propagation event)
|
||||
|
|
|
@ -414,9 +414,11 @@
|
|||
|
||||
on-component-drag-start
|
||||
(mf/use-fn
|
||||
(mf/deps component selected-components item-ref on-drag-start)
|
||||
(mf/deps component selected-components item-ref on-drag-start workspace-read-only?)
|
||||
(fn [event]
|
||||
(on-asset-drag-start event component selected-components item-ref :components on-drag-start)))]
|
||||
(if workspace-read-only?
|
||||
(dom/prevent-default event)
|
||||
(on-asset-drag-start event component selected-components item-ref :components on-drag-start))))]
|
||||
|
||||
[:div {:ref item-ref
|
||||
:class (dom/classnames
|
||||
|
@ -795,9 +797,11 @@
|
|||
|
||||
on-grahic-drag-start
|
||||
(mf/use-fn
|
||||
(mf/deps object selected-objects item-ref on-drag-start)
|
||||
(mf/deps object selected-objects item-ref on-drag-start workspace-read-only?)
|
||||
(fn [event]
|
||||
(on-asset-drag-start event object selected-objects item-ref :graphics on-drag-start)))]
|
||||
(if workspace-read-only?
|
||||
(dom/prevent-default event)
|
||||
(on-asset-drag-start event object selected-objects item-ref :graphics on-drag-start))))]
|
||||
|
||||
[:div {:ref item-ref
|
||||
:class-name (dom/classnames
|
||||
|
@ -1262,9 +1266,11 @@
|
|||
|
||||
on-color-drag-start
|
||||
(mf/use-fn
|
||||
(mf/deps color selected-colors item-ref)
|
||||
(mf/deps color selected-colors item-ref workspace-read-only?)
|
||||
(fn [event]
|
||||
(on-asset-drag-start event color selected-colors item-ref :colors identity)))]
|
||||
(if workspace-read-only?
|
||||
(dom/prevent-default event)
|
||||
(on-asset-drag-start event color selected-colors item-ref :colors identity))))]
|
||||
|
||||
(mf/use-effect
|
||||
(mf/deps (:editing @state))
|
||||
|
@ -1574,9 +1580,11 @@
|
|||
|
||||
on-typography-drag-start
|
||||
(mf/use-fn
|
||||
(mf/deps typography selected-typographies item-ref)
|
||||
(mf/deps typography selected-typographies item-ref workspace-read-only?)
|
||||
(fn [event]
|
||||
(on-asset-drag-start event typography selected-typographies item-ref :typographies identity)))]
|
||||
(if workspace-read-only?
|
||||
(dom/prevent-default event)
|
||||
(on-asset-drag-start event typography selected-typographies item-ref :typographies identity))))]
|
||||
|
||||
[:div.typography-container {:ref item-ref
|
||||
:draggable (not workspace-read-only?)
|
||||
|
|
Loading…
Add table
Reference in a new issue