mirror of
https://github.com/penpot/penpot.git
synced 2026-07-21 05:27:50 +00:00
🐛 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 <niwi@niwi.nz> Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
1b84655fb4
commit
aba6e214ed
@ -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)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user