Skip to content

Commit d86fd67

Browse files
committed
Fix display of select multiple HTML fields. Closes #3290.
1 parent b4b2dc1 commit d86fd67

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

rest_framework/templates/rest_framework/horizontal/select_multiple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{% elif select.end_option_group %}
1717
</optgroup>
1818
{% else %}
19-
<option value="{{ select.value }}" {% if select.value == field.value %}selected{% endif %}>{{ select.display_text }}</option>
19+
<option value="{{ select.value }}" {% if select.value in field.value %}selected{% endif %}>{{ select.display_text }}</option>
2020
{% endif %}
2121
{% empty %}
2222
<option>{{ no_items }}</option>

rest_framework/templates/rest_framework/inline/select_multiple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% elif select.end_option_group %}
1616
</optgroup>
1717
{% else %}
18-
<option value="{{ select.value }}" {% if select.value == field.value %}selected{% endif %}>{{ select.display_text }}</option>
18+
<option value="{{ select.value }}" {% if select.value in field.value %}selected{% endif %}>{{ select.display_text }}</option>
1919
{% endif %}
2020
{% empty %}
2121
<option>{{ no_items }}</option>

rest_framework/templates/rest_framework/vertical/select_multiple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% elif select.end_option_group %}
1616
</optgroup>
1717
{% else %}
18-
<option value="{{ select.value }}" {% if select.value == field.value %}selected{% endif %}>{{ select.display_text }}</option>
18+
<option value="{{ select.value }}" {% if select.value in field.value %}selected{% endif %}>{{ select.display_text }}</option>
1919
{% endif %}
2020
{% empty %}
2121
<option>{{ no_items }}</option>

0 commit comments

Comments
 (0)