0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

🎉 Add feature to focus input on search when searching a file at projects dashboard

This commit is contained in:
Akshay Gupta 2023-04-28 12:20:04 +05:30 committed by Alejandro Alonso
parent 86b0e95458
commit 45356ae1fc

View file

@ -17,6 +17,7 @@
[app.main.data.users :as du]
[app.main.features :as features]
[app.main.repo :as rp]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]]
[app.util.router :as rt]
[app.util.timers :as tm]
@ -999,8 +1000,10 @@
(watch [_ state _]
(let [team-id (:current-team-id state)]
(if (empty? term)
(rx/of (rt/nav :dashboard-search
{:team-id team-id}))
(do
(dom/focus! (dom/get-element "search-input"))
(rx/of (rt/nav :dashboard-search
{:team-id team-id})))
(rx/of (rt/nav :dashboard-search
{:team-id team-id}
{:search-term term}))))))))