From 2e3cdd872cbca371ff2b44aefc68759b7d76f934 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 17 Jul 2025 13:01:24 +0200 Subject: [PATCH] Revert ":sparkles: Highlight first found font in font list when searching [Taiga #3204]" This reverts commit 55a13c3139c682db296b800c17edf3f71c95a754. --- CHANGES.md | 1 - .../workspace/sidebar/options/menus/typography.cljs | 11 +++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 58451b0b9f..8a1ed74397 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,7 +20,6 @@ - Provide CSS `mix-blend-mode` property in code editor when present on shape [Taiga #11282](https://tree.taiga.io/project/penpot/issue/11282) - Add the option to import tokens in a .zip file. [Taiga #11378](https://tree.taiga.io/project/penpot/us/11378) - New typography token type - font size token [Taiga #10938](https://tree.taiga.io/project/penpot/us/10938) -- Highlight first found font in the font list when searching, and allow Enter to select it. [Taiga #3204](https://tree.taiga.io/project/penpot/issue/3204) ### :bug: Bugs fixed - Copying font size does not copy the unit [Taiga #11143](https://tree.taiga.io/project/penpot/issue/11143) 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 9d36f13a61..6f4db43e23 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 @@ -112,13 +112,8 @@ recent-fonts (mf/with-memo [state recent-fonts] (filter-fonts state recent-fonts)) - full-size? (boolean (and full-size show-recent)) - ;; --- NEW: auto-select first font on search --- - _auto-select-first - (mf/with-effect [(:term state) fonts] - (when (and (seq fonts) (not (str/blank? (:term state)))) - (reset! selected (first fonts)))) + full-size? (boolean (and full-size show-recent)) select-next (mf/use-fn @@ -138,13 +133,13 @@ on-key-down (mf/use-fn - (mf/deps fonts selected) + (mf/deps fonts) (fn [event] (cond (kbd/up-arrow? event) (select-prev event) (kbd/down-arrow? event) (select-next event) (kbd/esc? event) (on-close) - (kbd/enter? event) (do (on-select @selected) (on-close)) + (kbd/enter? event) (on-close) :else (dom/focus! (mf/ref-val input))))) on-filter-change