🐛 Fix font name hot update (#7316)

This commit is contained in:
Eva Marco
2025-09-16 12:23:41 +02:00
committed by GitHub
parent 90a80c4b63
commit 01e963ae35
2 changed files with 3 additions and 7 deletions

View File

@@ -828,7 +828,7 @@ custom-input-token-value-props: Custom props passed to the custom-input-token-va
on-select-font
(mf/use-fn
(mf/deps on-external-update-value set-font)
(mf/deps on-external-update-value set-font font)
(fn [{:keys [family] :as font}]
(when font
(set-font font)
@@ -854,7 +854,7 @@ custom-input-token-value-props: Custom props passed to the custom-input-token-va
{:placeholder (or placeholder (tr "workspace.tokens.token-font-family-value-enter"))
:label label
:aria-label aria-label
:default-value default-value
:value (or (:name font) default-value)
:ref input-ref
:on-blur on-blur
:on-change on-update-value'

View File

@@ -58,19 +58,15 @@
(mf/defc input-token*
{::mf/forward-ref true
::mf/schema schema::input-token}
[{:keys [class label placeholder value icon slot-start token-resolve-result] :rest props} ref]
[{:keys [class label token-resolve-result] :rest props} ref]
(let [error (not (nil? (:errors token-resolve-result)))
id (mf/use-id)
input-ref (mf/use-ref)
props (mf/spread-props props {:id id
:type "text"
:class (stl/css :input)
:placeholder placeholder
:value value
:variant "comfortable"
:hint-type (when error "error")
:slot-start slot-start
:icon icon
:ref (or ref input-ref)})]
[:*
[:div {:class (dm/str class " " (stl/css-case :wrapper true