Skip to content

Commit

Permalink
explicit note on CheckBoxFieldWidget import.
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Jul 27, 2023
1 parent b9ea535 commit affcebe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion plone/app/z3cform/templates/checkbox_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
we cannot autoset the attributes here with "view/attributes",
because the "id" would get overwritten with the field_id
instead of the correct sequence_item_id -->
<input class="${view/attributes/class}"
<!--! NOTE #2:
Since most people import the "CheckBoxFieldWidget"
directly from z3c.form.browser.checkbox our adapter
which sets the Bootstrap "form-check-input" css class
isn't invoked. For this reason we manually add the
class here in the template.
When all imports are refactored to
"plone.app.z3cform.widgets.checkbox.CheckBoxFieldWidget"
this can be cleaned up. -->
<input class="${view/attributes/class} form-check-input"
id="${item/id}"
checked="${python:'checked' if item['checked'] else None}"
name="${item/name}"
Expand Down

0 comments on commit affcebe

Please sign in to comment.