reagent-project / reagent-forms

Bootstrap form components for Reagent
339 stars 78 forks source link

Radio button doesn't update if dynamically changed #79

Closed jasiskis closed 8 years ago

jasiskis commented 8 years ago

When the referenced atom is dynamically changed the radio button option is not selected accordingly.

eg:

(def project-form
  [:div
   [:input.radio-inline {:field :radio :value true :name :approved} "Yes"]
   [:input.radio-inline {:field :radio :value false :name :approved} "No"]])

(defn project-page []
  (let [project (atom {:approved false})]
    (js/setTimeout #(reset! project {:approved true}) 1000)
    (fn []
      [:div.container
       [bind-fields project-form project]
       [:button {:on-click #(js/console.log (str @project))}]])))
yogthos commented 8 years ago

sounds like the same issue https://github.com/reagent-project/reagent-forms/issues/19