Skip to content

Commit bc45918

Browse files
authored
fix: custom select2 init (#800)
1 parent dbb48f5 commit bc45918

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/unfold/contrib/filters/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DropdownForm(forms.Form):
2626
widget = UnfoldAdminSelectWidget(
2727
attrs={
2828
"data-theme": "admin-autocomplete",
29-
"class": "admin-autocomplete",
29+
"class": "unfold-admin-autocomplete admin-autocomplete",
3030
}
3131
)
3232
field = ChoiceField
@@ -38,7 +38,7 @@ def __init__(self, name, label, choices, multiple=False, *args, **kwargs):
3838
self.widget = UnfoldAdminSelectMultipleWidget(
3939
attrs={
4040
"data-theme": "admin-autocomplete",
41-
"class": "admin-autocomplete",
41+
"class": "unfold-admin-autocomplete admin-autocomplete",
4242
}
4343
)
4444
self.field = MultipleChoiceField

src/unfold/static/unfold/js/select2.init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
};
1111

1212
$(function () {
13-
$(".admin-autocomplete").djangoCustomSelect2();
13+
$(".unfold-admin-autocomplete.admin-autocomplete").djangoCustomSelect2();
1414
});
1515
}

0 commit comments

Comments
 (0)