Skip to content

Commit b4ec13f

Browse files
committed
Fix reagent-project#259: Call original ref in ReagentInput
1 parent b4c9b4d commit b4ec13f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/reagent/impl/template.cljs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@
174174
(.hasOwnProperty jsprops "value"))
175175
(let [v ($ jsprops :value)
176176
value (if (nil? v) "" v)
177-
on-change ($ jsprops :onChange)]
177+
on-change ($ jsprops :onChange)
178+
original-ref ($ jsprops :ref)]
178179
(when (nil? ($ this :cljsInputElement))
179180
;; set initial value
180181
($! this :cljsDOMValue value))
@@ -183,7 +184,9 @@
183184
(doto jsprops
184185
($! :defaultValue value)
185186
($! :onChange #(input-handle-change this on-change %))
186-
($! :ref #($! this :cljsInputElement %1))))))
187+
($! :ref (fn [el]
188+
(if original-ref (original-ref el))
189+
($! this :cljsInputElement el)))))))
187190

188191
(defn ^boolean input-component? [x]
189192
(case x

0 commit comments

Comments
 (0)