Don't pass on-save as props to input field.

Fixes #8
This commit is contained in:
Daniel Compton 2016-12-15 10:52:09 +13:00
parent db2d11bcbc
commit 0aaf6ce77f
1 changed files with 10 additions and 11 deletions

View File

@ -113,17 +113,16 @@
(defn search-input [{:keys [title on-save on-stop]}]
(let [val (r/atom title)
save #(let [v (-> @val str clojure.string/trim)]
(on-save v))]
(fn [props]
[:input (merge props
{:type "text"
:value @val
:auto-focus true
:on-blur save
:on-change #(reset! val (-> % .-target .-value))
:on-key-down #(case (.-which %)
13 (save)
nil)})])))
(on-save v))]
(fn []
[:input {:type "text"
:value @val
:auto-focus true
:on-blur save
:on-change #(reset! val (-> % .-target .-value))
:on-key-down #(case (.-which %)
13 (save)
nil)}])))
(defn render-traces []