🐛 Fix props on text components (#9099)

This commit is contained in:
Eva Marco 2026-04-23 10:49:48 +02:00 committed by GitHub
parent d43d1f431f
commit 28b33b9acc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 19 deletions

View File

@ -27,7 +27,7 @@
[app.main.ui.ds.foundations.assets.icon :as i]
[app.main.ui.hooks :as hooks]
[app.main.ui.icons :as deprecated-icon]
[app.main.ui.workspace.sidebar.options.menus.typography :refer [text-options
[app.main.ui.workspace.sidebar.options.menus.typography :refer [text-options*
typography-entry]]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]]
@ -297,18 +297,19 @@
multiple? (->> values vals (d/seek #(= % :multiple)))
opts #js {:ids ids
:values values
:on-change on-change
:show-recent true
:on-blur
(fn []
(ts/schedule
100
(fn []
(when (not= "INPUT" (-> (dom/get-active) (dom/get-tag-name)))
(let [node (txu/get-text-editor-content)]
(dom/focus! node))))))}]
opts (mf/props
{:ids ids
:values values
:on-change on-change
:show-recent true
:on-blur
(fn []
(ts/schedule
100
(fn []
(when (not= "INPUT" (-> (dom/get-active) (dom/get-tag-name)))
(let [node (txu/get-text-editor-content)]
(dom/focus! node))))))})]
(hooks/use-stream
expand-stream
@ -346,7 +347,7 @@
deprecated-icon/detach]]
:else
[:> text-options opts])
[:> text-options* opts])
[:div {:class (stl/css :text-align-options)}
[:> text-align-options* opts]

View File

@ -444,8 +444,7 @@
:value "lowercase"
:id "text-transform-lowercase"}]]]))
(mf/defc text-options
{::mf/wrap-props false}
(mf/defc text-options*
[{:keys [ids editor values on-change on-blur show-recent]}]
(let [full-size-selector? (and show-recent (= (mf/use-ctx ctx/sidebar) :right))
opts #js {:editor editor
@ -502,9 +501,9 @@
:on-click on-close}
deprecated-icon/tick]]
[:& text-options {:values typography
:on-change on-change
:show-recent false}]]
[:> text-options* {:values typography
:on-change on-change
:show-recent false}]]
[:div {:class (stl/css :typography-info-wrapper)}
[:div {:class (stl/css :typography-name-wrapper)}