Closed arttuka closed 7 years ago
Thanks for the report, I'll have to take a look at this when I get a chance.
This bug seems to have disappeared with Reagent 0.6.0 final.
glad to hear it. I'm meaning to do a bit of cleanup and I'll update to latest Reagent in the process. So, hopefully the next release should have some of the issues addressed.
I'm using Reagent 0.6.0 and the bug's still there.
I'm unable to reproduce this with 0.6.0 actually, here's what I have:
(def template
[:select.form-control {:field :list :id :many-options}
[:option {:key :foo} "foo"]
[:option {:key :bar} "bar"]
[:option {:key :baz} "baz"]])
(defn home-page []
(reagent/with-let [doc (atom {:many-options :bar})]
[:div
[bind-fields template doc]
[:p (str @doc)]]))
The select is correctly initialized to :bar
in my case.
@hosiawak Have you tried making sure that you've cleaned the project when updating the version?
@yogthos - I created a new project from scratch and it's fine now so I believe the issue can be closed.
Wondering how I can clean the old project apart from running lein clean
?
I removed ~/.m2/repository/project-name
and it has fixed it, many thanks.
glad to hear it's working
With Reagent 0.6.0, setting the initial value for a :list field no longer works. The first option is always initially selected, even if there is a value in the doc for the field.
To repeat the issue, add
[reagent "0.6.0-rc"]
to dependencies in the example project. Then the option list will initially display "foo" even though the initial value is set to "bar".