diff --git a/src/reagent/impl/template.cljs b/src/reagent/impl/template.cljs index 83268f9..9038730 100644 --- a/src/reagent/impl/template.cljs +++ b/src/reagent/impl/template.cljs @@ -168,6 +168,7 @@ ;; Don't rely on React for updating "controlled inputs", since it ;; doesn't play well with async rendering (misses keystrokes). (if (and (some? find-dom-node) + (some? jsprops) ($ jsprops hasOwnProperty "onChange") ($ jsprops hasOwnProperty "value")) (let [v ($ jsprops :value) diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index 4df3eeb..3e93c1a 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -952,3 +952,7 @@ (is (= (.-innerHTML @ref) "foobar")) (is (= (.-innerHTML @node) "foobar")) (is (identical? @ref @node)))))) + +(deftest test-empty-input + (is (= "
" + (rstr [:div [:input]]))))