mirror of
https://github.com/django/django.git
synced 2025-07-25 14:14:13 +00:00
Fixed #19874: Apply id attribute to the outer <ul> of CheckboxSelectMultiple
This commit is contained in:
parent
3f05c70be0
commit
844fbc85c1
4 changed files with 10 additions and 4 deletions
|
@ -690,7 +690,8 @@ class CheckboxSelectMultiple(SelectMultiple):
|
|||
if value is None: value = []
|
||||
final_attrs = self.build_attrs(attrs, name=name)
|
||||
id_ = final_attrs.get('id', None)
|
||||
output = ['<ul>']
|
||||
start_tag = format_html('<ul id="{0}">', id_) if id_ else '<ul>'
|
||||
output = [start_tag]
|
||||
# Normalize to strings
|
||||
str_values = set([force_text(v) for v in value])
|
||||
for i, (option_value, option_label) in enumerate(chain(self.choices, choices)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue