Make todomvc feel more responsive

This commit is contained in:
Dan Holmsand 2014-11-11 11:08:43 +01:00
parent d188be004e
commit b1bec33448
1 changed files with 4 additions and 4 deletions

View File

@ -35,10 +35,10 @@
[:input (merge props [:input (merge props
{:type "text" :value @val :on-blur save {:type "text" :value @val :on-blur save
:on-change #(reset! val (-> % .-target .-value)) :on-change #(reset! val (-> % .-target .-value))
:on-key-up #(case (.-which %) :on-key-down #(case (.-which %)
13 (save) 13 (save)
27 (stop) 27 (stop)
nil)})]))) nil)})])))
(def todo-edit (with-meta todo-input (def todo-edit (with-meta todo-input
{:component-did-mount #(.focus (reagent/dom-node %))})) {:component-did-mount #(.focus (reagent/dom-node %))}))