Search input on Discover can leave header in indeterminate state (#695)

This commit is contained in:
alwx 2017-01-14 17:15:10 +03:00
parent 42b14e71df
commit 9f5aee0146
1 changed files with 3 additions and 2 deletions

View File

@ -67,6 +67,8 @@
{:style st/toolbar-search-input {:style st/toolbar-search-input
:auto-focus true :auto-focus true
:placeholder search-placeholder :placeholder search-placeholder
:return-key-type "search"
:on-blur #(dispatch [:set-in [:toolbar-search :show] nil])
:on-change-text #(dispatch [:set-in [:toolbar-search :text] %]) :on-change-text #(dispatch [:set-in [:toolbar-search :text] %])
:on-submit-editing #(toolbar-search-submit on-search-submit)}] :on-submit-editing #(toolbar-search-submit on-search-submit)}]
[view [view
@ -82,8 +84,7 @@
on-search-submit] on-search-submit]
:as opts}] :as opts}]
(let [toggle-search-fn #(dispatch [:set-in [:toolbar-search :show] %]) (let [toggle-search-fn #(dispatch [:set-in [:toolbar-search :show] %])
actions (if show-search? actions (if-not show-search?
[(act/search #(toolbar-search-submit on-search-submit))]
(into actions [(act/search #(toggle-search-fn search-key))]))] (into actions [(act/search #(toggle-search-fn search-key))]))]
[toolbar {:style (merge st/toolbar-with-search style) [toolbar {:style (merge st/toolbar-with-search style)
:nav-action (if show-search? :nav-action (if show-search?