mirror of https://github.com/status-im/reagent.git
Fix #259: Call original ref in ReagentInput
This commit is contained in:
parent
b4c9b4d537
commit
b4ec13f003
|
@ -174,7 +174,8 @@
|
||||||
(.hasOwnProperty jsprops "value"))
|
(.hasOwnProperty jsprops "value"))
|
||||||
(let [v ($ jsprops :value)
|
(let [v ($ jsprops :value)
|
||||||
value (if (nil? v) "" v)
|
value (if (nil? v) "" v)
|
||||||
on-change ($ jsprops :onChange)]
|
on-change ($ jsprops :onChange)
|
||||||
|
original-ref ($ jsprops :ref)]
|
||||||
(when (nil? ($ this :cljsInputElement))
|
(when (nil? ($ this :cljsInputElement))
|
||||||
;; set initial value
|
;; set initial value
|
||||||
($! this :cljsDOMValue value))
|
($! this :cljsDOMValue value))
|
||||||
|
@ -183,7 +184,9 @@
|
||||||
(doto jsprops
|
(doto jsprops
|
||||||
($! :defaultValue value)
|
($! :defaultValue value)
|
||||||
($! :onChange #(input-handle-change this on-change %))
|
($! :onChange #(input-handle-change this on-change %))
|
||||||
($! :ref #($! this :cljsInputElement %1))))))
|
($! :ref (fn [el]
|
||||||
|
(if original-ref (original-ref el))
|
||||||
|
($! this :cljsInputElement el)))))))
|
||||||
|
|
||||||
(defn ^boolean input-component? [x]
|
(defn ^boolean input-component? [x]
|
||||||
(case x
|
(case x
|
||||||
|
|
Loading…
Reference in New Issue