🐛 Fixed styles for typography advanced options

This commit is contained in:
alonso.torres 2020-12-04 15:22:59 +01:00 committed by Alonso Torres
parent 0da16c7219
commit 62d98ad265
4 changed files with 15 additions and 13 deletions

View file

@ -13,13 +13,21 @@
[app.util.dom :as dom]))
(mf/defc advanced-options [{:keys [visible? on-close children]}]
(let [handle-click (fn [event] (when on-close
(let [ref (mf/use-ref nil)
handle-click (fn [event] (when on-close
(do (dom/stop-propagation event)
(on-close))))]
(mf/use-effect
(mf/deps visible?)
(fn []
(when-let [node (mf/ref-val ref)]
(when visible?
(.scrollIntoViewIfNeeded ^js node)))))
(when visible?
[:*
[:div.focus-overlay {:on-click handle-click}]
[:div.advanced-options-wrapper
[:div.advanced-options-wrapper {:ref ref}
[:div.advanced-options {}
children]]])))

View file

@ -270,7 +270,7 @@
(if read-only?
[:div.element-set-content.typography-read-only-data
[:div.row-flex.typography-name
[:spang (:name typography)]]
[:span (:name typography)]]
[:div.row-flex
[:span.label (t locale "workspace.assets.typography.font-id")]