Skip to content

Commit 83052e3

Browse files
committed
Only delete the .select2-container if it contains a .django-select2
1 parent fb0ba65 commit 83052e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_select2/static/django_select2/django_select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
// Because select2 was already instantiated on the empty form, we need to remove it, destroy the instance,
7979
// and re-instantiate it.
80-
jqRow.find('.select2-container').remove()
80+
jqRow.find('.django-select2').parent().find('.select2-container').remove()
8181
jqRow.find('.django-select2').djangoSelect2('destroy');
8282
jqRow.find('.django-select2').djangoSelect2()
8383
}

0 commit comments

Comments
 (0)