Merge pull request #723 from status-im/bug/#695

Search input on Discover can leave header in indeterminate state (#695)
This commit is contained in:
Roman Volosovskyi 2017-01-16 11:16:34 +02:00 committed by GitHub
commit 9d7c2867b6
1 changed files with 3 additions and 2 deletions

View File

@ -66,6 +66,8 @@
{:style st/toolbar-search-input
:auto-focus true
: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-submit-editing #(toolbar-search-submit on-search-submit)}]
[view
@ -81,8 +83,7 @@
on-search-submit]
:as opts}]
(let [toggle-search-fn #(dispatch [:set-in [:toolbar-search :show] %])
actions (if show-search?
[(act/search #(toolbar-search-submit on-search-submit))]
actions (if-not show-search?
(into actions [(act/search #(toggle-search-fn search-key))]))]
[toolbar {:style (merge st/toolbar-with-search style)
:nav-action (if show-search?