mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Fix can't select a board in inspect mode
This commit is contained in:
parent
90bc9943bc
commit
cd6aa8f691
3 changed files with 5 additions and 6 deletions
|
@ -154,7 +154,7 @@
|
|||
|
||||
on-frame-enter (actions/on-frame-enter frame-hover)
|
||||
on-frame-leave (actions/on-frame-leave frame-hover)
|
||||
on-frame-select (actions/on-frame-select selected)
|
||||
on-frame-select (actions/on-frame-select selected workspace-read-only?)
|
||||
|
||||
disable-events? (contains? layout :comments)
|
||||
show-comments? (= drawing-tool :comments)
|
||||
|
|
|
@ -125,16 +125,16 @@
|
|||
(st/emit! (dw/start-move-selected))))))))
|
||||
|
||||
(defn on-frame-select
|
||||
[selected]
|
||||
[selected workspace-read-only?]
|
||||
(mf/use-callback
|
||||
(mf/deps selected)
|
||||
(mf/deps selected workspace-read-only?)
|
||||
(fn [event id]
|
||||
(let [shift? (kbd/shift? event)
|
||||
selected? (contains? selected id)
|
||||
selected-drawtool (deref refs/selected-drawing-tool)]
|
||||
(st/emit! (when (or shift? (not selected?))
|
||||
(dw/select-shape id shift?))
|
||||
(when (and (nil? selected-drawtool) (not shift?))
|
||||
(when (and (nil? selected-drawtool) (not shift?) (not workspace-read-only?))
|
||||
(dw/start-move-selected)))))))
|
||||
|
||||
(defn on-frame-enter
|
||||
|
|
|
@ -97,8 +97,7 @@
|
|||
(when (= 1 (.-which event))
|
||||
(dom/prevent-default event)
|
||||
(dom/stop-propagation event)
|
||||
(when-not workspace-read-only?
|
||||
(on-frame-select event (:id frame)))))))
|
||||
(on-frame-select event (:id frame))))))
|
||||
|
||||
on-double-click
|
||||
(mf/use-callback
|
||||
|
|
Loading…
Add table
Reference in a new issue