From 45356ae1fcee262f6304dc85f72ce5a64c0e25df Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Fri, 28 Apr 2023 12:20:04 +0530 Subject: [PATCH] :tada: Add feature to focus input on search when searching a file at projects dashboard --- frontend/src/app/main/data/dashboard.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index 86352517b..165cd178c 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -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}))))))))