mirror of
https://github.com/penpot/penpot.git
synced 2025-05-20 02:56:12 +02:00
🐛 Fix issue with drag-select shapes
This commit is contained in:
parent
13ca506015
commit
4a3fb55b30
4 changed files with 11 additions and 6 deletions
|
@ -82,6 +82,7 @@
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Fix issue with shift+select to deselect shapes [Taiga #3154](https://tree.taiga.io/project/penpot/issue/3154)
|
- Fix issue with shift+select to deselect shapes [Taiga #3154](https://tree.taiga.io/project/penpot/issue/3154)
|
||||||
|
- Fix issue with drag-select shapes [Taiga #3165](https://tree.taiga.io/project/penpot/issue/3165)
|
||||||
|
|
||||||
## 1.12.2-beta
|
## 1.12.2-beta
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,10 @@
|
||||||
(rx/dedupe)
|
(rx/dedupe)
|
||||||
(rx/map #(select-shapes-by-current-selrect preserve? ignore-groups?))))
|
(rx/map #(select-shapes-by-current-selrect preserve? ignore-groups?))))
|
||||||
|
|
||||||
(rx/of (update-selrect nil)))))))
|
(->> (rx/of (update-selrect nil))
|
||||||
|
;; We need the async so the current event finishes before updating the selrect
|
||||||
|
;; otherwise the `on-click` event will trigger with a `nil` selrect
|
||||||
|
(rx/observe-on :async)))))))
|
||||||
|
|
||||||
;; --- Toggle shape's selection status (selected or deselected)
|
;; --- Toggle shape's selection status (selected or deselected)
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
node-editing? (and edition (not= :text (get-in base-objects [edition :type])))
|
node-editing? (and edition (not= :text (get-in base-objects [edition :type])))
|
||||||
text-editing? (and edition (= :text (get-in base-objects [edition :type])))
|
text-editing? (and edition (= :text (get-in base-objects [edition :type])))
|
||||||
|
|
||||||
on-click (actions/on-click hover selected edition drawing-path? drawing-tool space?)
|
on-click (actions/on-click hover selected edition drawing-path? drawing-tool space? selrect)
|
||||||
on-context-menu (actions/on-context-menu hover hover-ids)
|
on-context-menu (actions/on-context-menu hover hover-ids)
|
||||||
on-double-click (actions/on-double-click hover hover-ids drawing-path? base-objects edition)
|
on-double-click (actions/on-double-click hover hover-ids drawing-path? base-objects edition)
|
||||||
on-drag-enter (actions/on-drag-enter)
|
on-drag-enter (actions/on-drag-enter)
|
||||||
|
|
|
@ -145,12 +145,13 @@
|
||||||
(reset! frame-hover nil))))
|
(reset! frame-hover nil))))
|
||||||
|
|
||||||
(defn on-click
|
(defn on-click
|
||||||
[hover selected edition drawing-path? drawing-tool space?]
|
[hover selected edition drawing-path? drawing-tool space? selrect]
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(mf/deps @hover selected edition drawing-path? drawing-tool @space?)
|
(mf/deps @hover selected edition drawing-path? drawing-tool @space? selrect)
|
||||||
(fn [event]
|
(fn [event]
|
||||||
(when (or (dom/class? (dom/get-target event) "viewport-controls")
|
(when (and (nil? selrect)
|
||||||
(dom/class? (dom/get-target event) "viewport-selrect"))
|
(or (dom/class? (dom/get-target event) "viewport-controls")
|
||||||
|
(dom/class? (dom/get-target event) "viewport-selrect")))
|
||||||
(let [ctrl? (kbd/ctrl? event)
|
(let [ctrl? (kbd/ctrl? event)
|
||||||
shift? (kbd/shift? event)
|
shift? (kbd/shift? event)
|
||||||
alt? (kbd/alt? event)
|
alt? (kbd/alt? event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue