Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix val not working when passed in an array of nodes

  • Loading branch information...
commit f8c34ded414ac0544aedee7c80bc1596015307ce 1 parent b7a1d72
@zk authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/cljs/nsfw/dom.cljs
View
9 src/cljs/nsfw/dom.cljs
@@ -70,11 +70,16 @@
([base o]
(selector base (name o))))
+(defn unwrap [el]
+ (if (coll? el)
+ (first el)
+ el))
+
(defn val
([el]
- (.-value (if (coll? el) (first el) el)))
+ (.-value (unwrap el)))
([el new-value]
- (set! (.-value el) new-value)))
+ (set! (.-value (unwrap el)) new-value)))
(defn wrap-content
[content]
Please sign in to comment.
Something went wrong with that request. Please try again.