From aba6e214edecf7d2d8c3d31b12b6900909a3ef32 Mon Sep 17 00:00:00 2001 From: Renzo <170978465+RenzoMXD@users.noreply.github.com> Date: Fri, 19 Jun 2026 16:29:45 +0700 Subject: [PATCH] :bug: Highlight first matching font when searching the font picker (#9512) Signed-off-by: RenzoMXD <170978465+RenzoMXD@users.noreply.github.com> Signed-off-by: Andrey Antukh Co-authored-by: Andrey Antukh --- .../main/ui/workspace/sidebar/options/menus/typography.cljs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index 38c15568dd..c188fcfd55 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -165,6 +165,12 @@ (let [key (events/listen js/document "keydown" on-key-down)] #(events/unlistenByKey key))) + (mf/with-effect [fonts] + (when (seq fonts) + (let [sel-id (:id @selected)] + (when-not (some #(= (:id %) sel-id) fonts) + (reset! selected (first fonts)))))) + (mf/with-effect [@selected] (when-let [inst (mf/ref-val flist)] (when-let [index (:index @selected)]