mirror of https://github.com/status-im/reagent.git
Make sure empty [:input] doesn't throw exception
This commit is contained in:
parent
45b93c8145
commit
63515236cb
|
@ -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)
|
||||
|
|
|
@ -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]]))))
|
||||
|
|
Loading…
Reference in New Issue