mirror of
https://github.com/penpot/penpot.git
synced 2025-05-15 05:06:39 +02:00
🐛 Fix unexpected console errors on removing shape.
Caused because in some instances selected shapes set will contain an id that is already removed from object. This is a tipical race condition.
This commit is contained in:
parent
239ec12529
commit
94ccc013d7
4 changed files with 15 additions and 11 deletions
|
@ -233,7 +233,8 @@
|
|||
:stroke-width (/ select-guide-width zoom)
|
||||
:stroke-dasharray (/ select-guide-dasharray zoom)}}])])
|
||||
|
||||
(mf/defc measurement [{:keys [bounds frame selected-shapes hover-shape zoom]}]
|
||||
(mf/defc measurement
|
||||
[{:keys [bounds frame selected-shapes hover-shape zoom]}]
|
||||
(let [selected-ids (into #{} (map :id) selected-shapes)
|
||||
selected-selrect (gsh/selection-rect selected-shapes)
|
||||
hover-selrect (:selrect hover-shape)
|
||||
|
|
|
@ -88,7 +88,11 @@
|
|||
zoom (d/check-num zoom 1)
|
||||
drawing-tool (:tool drawing)
|
||||
drawing-obj (:object drawing)
|
||||
selected-shapes (->> selected (mapv #(get objects %)))
|
||||
|
||||
selected-shapes (into []
|
||||
(comp (map #(get objects %))
|
||||
(filter some?))
|
||||
selected)
|
||||
selected-frames (into #{} (map :frame-id) selected-shapes)
|
||||
|
||||
;; Only when we have all the selected shapes in one frame
|
||||
|
|
|
@ -97,7 +97,8 @@
|
|||
shapes (->> outlines-ids
|
||||
(filter #(not= edition %))
|
||||
(map #(get objects %))
|
||||
(filterv show-outline?))]
|
||||
(filterv show-outline?)
|
||||
(filter some?))]
|
||||
|
||||
[:g.outlines {:display (when (some? transform) "none")}
|
||||
[:& shape-outlines-render {:shapes shapes
|
||||
|
|
|
@ -90,9 +90,7 @@
|
|||
(let [target (.-target ^js event)]
|
||||
(when (and (not (.-isContentEditable target)) ;; ignore when pasting into
|
||||
(not= (.-tagName target) "INPUT")) ;; an editable control
|
||||
(-> ^js event
|
||||
(.getBrowserEvent)
|
||||
(.-clipboardData)))))
|
||||
(.. ^js event getBrowserEvent -clipboardData))))
|
||||
|
||||
(defn extract-text
|
||||
[clipboard-data]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue