(defn
input-render-setup
([this jsprops {:keys [synthetic-on-update synthetic-on-change]}]
(when
(and
(some? jsprops)
(.hasOwnProperty jsprops "onChange")
(.hasOwnProperty jsprops "value"))
(assert
find-dom-node
"reagent.dom needs to be loaded for controlled input to work")
(when
synthetic-on-update
($! this :cljsSyntheticOnUpdate synthetic-on-update))
(let
[v
($ jsprops :value)
value
(if (nil? v) "" v)
on-change
($ jsprops :onChange)
on-change
(if
synthetic-on-change
(partial synthetic-on-change on-change)
on-change)]
(when-not
($ this :cljsInputLive)
($! this :cljsInputLive true)
($! this :cljsDOMValue value))
($! this :cljsRenderedValue value)
(js-delete jsprops "value")
(doto
jsprops
($! :defaultValue value)
($!
:onChange
(fn*
[p1__18473#]
(input-handle-change this on-change p1__18473#)))))))
([this jsprops] (input-render-setup this jsprops {})))