There was an error while loading. Please reload this page.
1 parent b4c9b4d commit b4ec13fCopy full SHA for b4ec13f
src/reagent/impl/template.cljs
@@ -174,7 +174,8 @@
174
(.hasOwnProperty jsprops "value"))
175
(let [v ($ jsprops :value)
176
value (if (nil? v) "" v)
177
- on-change ($ jsprops :onChange)]
+ on-change ($ jsprops :onChange)
178
+ original-ref ($ jsprops :ref)]
179
(when (nil? ($ this :cljsInputElement))
180
;; set initial value
181
($! this :cljsDOMValue value))
@@ -183,7 +184,9 @@
183
184
(doto jsprops
185
($! :defaultValue value)
186
($! :onChange #(input-handle-change this on-change %))
- ($! :ref #($! this :cljsInputElement %1))))))
187
+ ($! :ref (fn [el]
188
+ (if original-ref (original-ref el))
189
+ ($! this :cljsInputElement el)))))))
190
191
(defn ^boolean input-component? [x]
192
(case x
0 commit comments