mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix props on text components (#9099)
This commit is contained in:
parent
d43d1f431f
commit
28b33b9acc
@ -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]
|
||||
|
||||
@ -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)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user