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:
parent
86b0e95458
commit
45356ae1fc
1 changed files with 5 additions and 2 deletions
|
@ -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}))))))))
|
||||
|
|
Loading…
Reference in a new issue