Parcourir la Source

pass type as value to fields.

because otherwise we'd have to `om/read` it in the change handler.
Lucas Stadler 12 ans auparavant
Parent
commit
e7ee050c2b
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      clj/clarity/cljs/clarity.cljs

+ 1 - 1
clj/clarity/cljs/clarity.cljs

131
  (fn [[k t]]
131
  (fn [[k t]]
132
    (dom/div #js {:className "field"}
132
    (dom/div #js {:className "field"}
133
      (dom/label nil (str k (when optional? " (optional)")))
133
      (dom/label nil (str k (when optional? " (optional)")))
134
      (om/build make-typed-input m {:opts {:type t, :key k, :val (k m)
134
      (om/build make-typed-input m {:opts {:type (om/value t), :key k, :val (k m)
135
                                           :optional? optional?}}))))
135
                                           :optional? optional?}}))))
136
136
137
(defmethod make-typed-input 'HMap [m owner {type :type}]
137
(defmethod make-typed-input 'HMap [m owner {type :type}]