From f19a8e67e1ea0471dbf0a2032b73028dcb88a232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 17 Apr 2020 10:15:02 +0200 Subject: [PATCH] :bug: Fix behavior of search box in dashboard --- frontend/src/uxbox/main/ui/dashboard.cljs | 3 ++- frontend/src/uxbox/main/ui/dashboard/sidebar.cljs | 10 ++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/frontend/src/uxbox/main/ui/dashboard.cljs b/frontend/src/uxbox/main/ui/dashboard.cljs index 8632d8d03..b27c8d1a6 100644 --- a/frontend/src/uxbox/main/ui/dashboard.cljs +++ b/frontend/src/uxbox/main/ui/dashboard.cljs @@ -71,7 +71,8 @@ [:& profile-section {:profile profile}] [:& sidebar {:team-id team-id :project-id project-id - :section page}] + :section page + :search-term search-term}] [:div.dashboard-content (case page :dashboard-search diff --git a/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs b/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs index 85a586f93..4f40ec287 100644 --- a/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs @@ -145,12 +145,6 @@ (debounced-emit! (rt/nav :dashboard-search {:team-id team-id} {})) (debounced-emit! (rt/nav :dashboard-search {:team-id team-id} {:search-term value}))))) - on-search-blur - (fn [event] - (let [target (dom/get-target event)] - (dom/clean-value! target))) - ;; (debounced-emit! (rt/nav :dashboard-team {:team-id team-id})))) - on-search-change (fn [event] (let [value (-> (dom/get-target event) @@ -175,8 +169,8 @@ :default-value search-term-not-nil :autoComplete "off" :on-focus on-search-focus - :on-blur on-search-blur - :on-change on-search-change}] + :on-change on-search-change + :ref #(when % (set! (.-value %) search-term-not-nil))}] [:div.clear-search {:on-click on-clear-click} i/close]]