Revert " Highlight first found font in font list when searching [Taiga #3204]"

This reverts commit 55a13c3139.
This commit is contained in:
Alejandro Alonso 2025-07-17 13:01:24 +02:00
parent 55a13c3139
commit 2e3cdd872c
2 changed files with 3 additions and 9 deletions

View file

@ -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)

View file

@ -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