mirror of
https://github.com/penpot/penpot.git
synced 2026-05-14 20:43:55 +00:00
🐛 Fix problem with colorpicker in multiselect color with texts (#9549)
This commit is contained in:
parent
c65b24495b
commit
c56f5cc01b
@ -90,7 +90,7 @@
|
||||
(d/without-nils))
|
||||
prev-color (d/seek (partial get groups) prev-colors)
|
||||
color-operations-old (get groups old-color)
|
||||
color-operations-prev (get groups prev-colors)
|
||||
color-operations-prev (get groups prev-color)
|
||||
color-operations (or color-operations-prev color-operations-old)
|
||||
old-color (or prev-color old-color)]
|
||||
[color-operations old-color]))
|
||||
@ -115,11 +115,17 @@
|
||||
;; TODO: Review if this is still necessary.
|
||||
prev-colors-ref (mf/use-ref nil)
|
||||
|
||||
;; Always keep this ref pointing to the latest groups so that on-change
|
||||
;; (which may be captured stale by the colorpicker's rx subscription) can
|
||||
;; still read the current groups and find the correct color operations.
|
||||
groups-ref (mf/use-ref nil)
|
||||
_ (mf/set-ref-val! groups-ref groups)
|
||||
|
||||
on-change
|
||||
(mf/use-fn
|
||||
(mf/deps groups)
|
||||
(fn [old-color new-color from-picker?]
|
||||
(let [prev-colors (mf/ref-val prev-colors-ref)
|
||||
(let [groups (mf/ref-val groups-ref)
|
||||
prev-colors (mf/ref-val prev-colors-ref)
|
||||
[color-operations old-color] (retrieve-color-operations groups old-color prev-colors)]
|
||||
|
||||
;; TODO: Review if this is still necessary.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user