🐛 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 [] (mf/use-effect (fn []
(let [sub (->> stream (rx/subs on-subscribe))] (let [sub (->> stream (rx/subs on-subscribe))]
#(rx/dispose! sub))))) #(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 nil
(= type :frame) (= type :frame)
(if selected? (when selected?
(do (do
(dom/stop-propagation event) (dom/stop-propagation event)
(st/emit! (dw/start-move-selected))) (st/emit! (dw/start-move-selected))))
(st/emit! (dw/deselect-all)))
:else :else
(do (do

View file

@ -20,6 +20,7 @@
[app.util.color :as uc] [app.util.color :as uc]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.ui.hooks :as h]
[app.main.ui.components.color-bullet :as cb] [app.main.ui.components.color-bullet :as cb]
[app.main.ui.components.numeric-input :refer [numeric-input]])) [app.main.ui.components.numeric-input :refer [numeric-input]]))
@ -120,12 +121,15 @@
disable-opacity disable-opacity
handle-pick-color handle-pick-color
handle-open handle-open
handle-close)))] handle-close)))
prev-color (h/use-previous color)]
(mf/use-effect (mf/use-effect
(mf/deps color) (mf/deps color prev-color)
(fn [] (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 [:div.row-flex.color-data
[:& cb/color-bullet {:color color [:& cb/color-bullet {:color color