mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 15:39:50 -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.data.users :as du]
|
||||||
[app.main.features :as features]
|
[app.main.features :as features]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
|
@ -999,8 +1000,10 @@
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [team-id (:current-team-id state)]
|
(let [team-id (:current-team-id state)]
|
||||||
(if (empty? term)
|
(if (empty? term)
|
||||||
|
(do
|
||||||
|
(dom/focus! (dom/get-element "search-input"))
|
||||||
(rx/of (rt/nav :dashboard-search
|
(rx/of (rt/nav :dashboard-search
|
||||||
{:team-id team-id}))
|
{:team-id team-id})))
|
||||||
(rx/of (rt/nav :dashboard-search
|
(rx/of (rt/nav :dashboard-search
|
||||||
{:team-id team-id}
|
{:team-id team-id}
|
||||||
{:search-term term}))))))))
|
{:search-term term}))))))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue