You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the SortedFilteredSelectMultiple widget other fields on the same admin page that use autocomplete (i.e., fields designated with the ModelAdmin.autocomplete_fields attribute) break.
It might be that the jquery instance used in admin/js/autocomplete.js is somehow swapped out with one that does not have the required functionality. Specifically the error message in the browser console is:
autocomplete.js:7 Uncaught TypeError: $(...).select2 is not a function
at HTMLSelectElement.<anonymous> (autocomplete.js:7:24)
at Function.each (jquery.min.js:16:11390)
at $.fn.djangoAdminSelect2 (autocomplete.js:6:11)
at HTMLDocument.<anonymous> (autocomplete.js:27:60)
at Object.resolveWith (jquery.min.js:16:14211)
at Function.ready (jquery.min.js:16:9196)
at HTMLDocument.y (jquery.min.js:16:13679)
The autocomplete fields work fine when not using SortedFilteredSelectMultiple. I suspect it has something todo with the order in which the javascript dependencies are included. But I'm unsure how to go about changing the order.
Any pointers on how to fix this issue are appreciated.
When using the
SortedFilteredSelectMultiple
widget other fields on the same admin page that use autocomplete (i.e., fields designated with theModelAdmin.autocomplete_fields
attribute) break.It might be that the jquery instance used in
admin/js/autocomplete.js
is somehow swapped out with one that does not have the required functionality. Specifically the error message in the browser console is:The autocomplete fields work fine when not using
SortedFilteredSelectMultiple
. I suspect it has something todo with the order in which the javascript dependencies are included. But I'm unsure how to go about changing the order.Any pointers on how to fix this issue are appreciated.
Versions:
Django 4.2.13
django-sortedm2m-filter-horizontal-widget 2.0.1
The text was updated successfully, but these errors were encountered: