🐛 Fix problem when changing colorpicker alpha (#5770)

This commit is contained in:
Alonso Torres 2025-02-06 10:49:42 +01:00 committed by GitHub
parent 0b90722d5a
commit cdfc0fd988
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 1 deletions

View file

@ -181,7 +181,8 @@
(when (or (not= (str/lower (:hex color)) (str/lower (:hex current-color)))
(not= (:h color) (:h current-color))
(not= (:s color) (:s current-color))
(not= (:v color) (:v current-color)))
(not= (:v color) (:v current-color))
(not= (:alpha color) (:alpha current-color)))
(let [recent-color (merge current-color color)
recent-color (dc/materialize-color-components recent-color)]
(st/emit! (dc/update-colorpicker-color recent-color (not @drag?)))))))

View file

@ -57,6 +57,7 @@
:hue (= type :hue)
:opacity (= type :opacity)
:value (= type :value)))
:data-testid (when (= type :opacity) "slider-opacity")
:on-pointer-down handle-start-drag
:on-pointer-up handle-stop-drag
:on-lost-pointer-capture handle-stop-drag