mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Merge pull request #7954 from penpot/azazeln28-fix-font-weight-mixed-value
🐛 Fix font weight mixed value
This commit is contained in:
@@ -60,6 +60,7 @@
|
|||||||
current-id (get state :id)
|
current-id (get state :id)
|
||||||
current-value (get state :current-value)
|
current-value (get state :current-value)
|
||||||
current-label (get label-index current-value)
|
current-label (get label-index current-value)
|
||||||
|
|
||||||
is-open? (get state :is-open?)
|
is-open? (get state :is-open?)
|
||||||
|
|
||||||
node-ref (mf/use-ref nil)
|
node-ref (mf/use-ref nil)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
[:> deprecated-input/numeric-input*
|
[:> deprecated-input/numeric-input*
|
||||||
{:placeholder (cond
|
{:placeholder (cond
|
||||||
(not all-equal?)
|
(not all-equal?)
|
||||||
"Mixed"
|
(tr "settings.multiple")
|
||||||
(= :multiple (:r1 values))
|
(= :multiple (:r1 values))
|
||||||
(tr "settings.multiple")
|
(tr "settings.multiple")
|
||||||
:else
|
:else
|
||||||
|
|||||||
@@ -264,11 +264,13 @@
|
|||||||
(mf/deps font on-change)
|
(mf/deps font on-change)
|
||||||
(fn [new-variant-id]
|
(fn [new-variant-id]
|
||||||
(let [variant (d/seek #(= new-variant-id (:id %)) (:variants font))]
|
(let [variant (d/seek #(= new-variant-id (:id %)) (:variants font))]
|
||||||
(on-change {:font-id (:id font)
|
(when-not (nil? variant)
|
||||||
:font-family (:family font)
|
(on-change {:font-id (:id font)
|
||||||
:font-variant-id new-variant-id
|
:font-family (:family font)
|
||||||
:font-weight (:weight variant)
|
:font-variant-id new-variant-id
|
||||||
:font-style (:style variant)})
|
:font-weight (:weight variant)
|
||||||
|
:font-style (:style variant)}))
|
||||||
|
|
||||||
(dom/blur! (dom/get-target new-variant-id)))))
|
(dom/blur! (dom/get-target new-variant-id)))))
|
||||||
|
|
||||||
on-font-select
|
on-font-select
|
||||||
@@ -341,12 +343,13 @@
|
|||||||
{:value (:id variant)
|
{:value (:id variant)
|
||||||
:key (pr-str variant)
|
:key (pr-str variant)
|
||||||
:label (:name variant)})))
|
:label (:name variant)})))
|
||||||
variant-options (if (= font-size :multiple)
|
variant-options (if (= font-variant-id :multiple)
|
||||||
(conj basic-variant-options
|
(conj basic-variant-options
|
||||||
{:value :multiple
|
{:value ""
|
||||||
:key :multiple-variants
|
:key :multiple-variants
|
||||||
:label "--"})
|
:label "--"})
|
||||||
basic-variant-options)]
|
basic-variant-options)]
|
||||||
|
|
||||||
;; TODO Add disabled mode
|
;; TODO Add disabled mode
|
||||||
[:& select
|
[:& select
|
||||||
{:class (stl/css :font-variant-select)
|
{:class (stl/css :font-variant-select)
|
||||||
|
|||||||
Reference in New Issue
Block a user