0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fixed problem with texts inside groups

This commit is contained in:
alonso.torres 2020-12-04 13:25:41 +01:00
parent a71a7d6951
commit e1ccde6533
3 changed files with 16 additions and 6 deletions

View file

@ -214,3 +214,10 @@
(mf/use-effect (fn []
(let [sub (->> stream (rx/subs on-subscribe))]
#(rx/dispose! sub)))))
;; https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
(defn use-previous [value]
(let [ref (mf/use-ref)]
(mf/use-effect
#(mf/set-ref-val! ref value))
(mf/ref-val ref)))

View file

@ -60,11 +60,10 @@
nil
(= type :frame)
(if selected?
(when selected?
(do
(dom/stop-propagation event)
(st/emit! (dw/start-move-selected)))
(st/emit! (dw/deselect-all)))
(st/emit! (dw/start-move-selected))))
:else
(do

View file

@ -20,6 +20,7 @@
[app.util.color :as uc]
[app.main.refs :as refs]
[app.main.data.modal :as modal]
[app.main.ui.hooks :as h]
[app.main.ui.components.color-bullet :as cb]
[app.main.ui.components.numeric-input :refer [numeric-input]]))
@ -120,12 +121,15 @@
disable-opacity
handle-pick-color
handle-open
handle-close)))]
handle-close)))
prev-color (h/use-previous color)]
(mf/use-effect
(mf/deps color)
(mf/deps color prev-color)
(fn []
(modal/update-props! :colorpicker {:data (parse-color color)})))
(when (not= prev-color color)
(modal/update-props! :colorpicker {:data (parse-color color)}))))
[:div.row-flex.color-data
[:& cb/color-bullet {:color color