Open bigforcegun opened 6 years ago
I agree with @bigforcegun. A set of checkboxes permits zero or more checked values. I would expect given a :collection
of possible values I can designate which of those are rendered with a checked
attribute. I'm working on a PR, but this is a little tricky given that the :default
and :with_collection
contexts both use the :value
option (differently), and the fact that its default value is set the same way in both of these contexts (via the default_checked_value
method.
Does a collection of checkboxes need a default value? This may only be useful for single boolean checkboxes.
Checkboxes with collection now support only one checked checkbox, when select with
multiple: 'multiple'
support multiple selected items.I suggest change method in
Formular::Element::Modules::Checkable
to something like this
aka in Select Element
Why?
It's unusual behavior in form builder with checkboxes. Array mean multiple choises and multiple checked elements.