mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 23:38:52 -04:00
Fix nested checkboxes with single top-level node
Nested checkboxes with a single top-level node will only have one item in their `items` list. This is because the other choices are children of that list item. This means we need to check the `choices` attribute, which lists all the checkboxes, to see if they should be marked as a group (by being wrapped in a `<fieldset>`) or not.
This commit is contained in:
@@ -588,7 +588,7 @@ class govukCheckboxesField(SelectMultipleField):
|
||||
}
|
||||
|
||||
# add HTML to group items if more than one
|
||||
if len(items) > 1:
|
||||
if len(field.choices) > 1:
|
||||
params.update({
|
||||
"fieldset": {
|
||||
"attributes": {"id": field.name},
|
||||
|
||||
Reference in New Issue
Block a user