reagent-project / reagent-forms

Bootstrap form components for Reagent
339 stars 78 forks source link

Allow non-keyword keys in selects. #27

Closed aeriksson closed 9 years ago

aeriksson commented 9 years ago

Currently, keys in selects have to be keywords, i.e…

[:ul.list-group {:field :single-select :id :pick-one}
  [:li.list-group-item {:key :foo} "foo"]
  [:li.list-group-item {:key :bar} "bar"]
  [:li.list-group-item {:key :baz} "baz"]]

…is allowed, but not…

[:ul.list-group {:field :single-select :id :pick-one}
  [:li.list-group-item {:key :foo} "foo"]
  [:li.list-group-item {:key 123} "bar"]
  [:li.list-group-item {:key "baz"} "baz"]]

While using keywords as keys is more idiomatic, using other types can be convenient (e.g. when populating forms from JSON data).

This pull request removes this constraint.

yogthos commented 9 years ago

sounds great