Make sure empty [:input] doesn't throw exception

This commit is contained in:
Dan Holmsand 2015-10-22 13:31:02 +02:00
parent 45b93c8145
commit 63515236cb
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -952,3 +952,7 @@
(is (= (.-innerHTML @ref) "foobar"))
(is (= (.-innerHTML @node) "foobar"))
(is (identical? @ref @node))))))
(deftest test-empty-input
(is (= "<div><input/></div>"
(rstr [:div [:input]]))))