yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.79k stars 467 forks source link

setting "theme" an select fields #1240

Closed kevin-olbrich closed 3 years ago

kevin-olbrich commented 3 years ago

Hi!

I like to use this: https://www.npmjs.com/package/select2-bootstrap-5-theme

How can I set "theme" in the select fields? When using this:

$("select").select2({
    theme: "bootstrap-5",
});

... I break the other options, the plugin alrady sets on the select.

How can I set this?

kevin-olbrich commented 3 years ago

$.fn.select2.defaults.set("theme", "bootstrap-5");

sabyasachi commented 3 years ago

$.fn.select2.defaults.set("theme", "bootstrap-5");

Did you get it to work with this?

kevin-olbrich commented 3 years ago

$.fn.select2.defaults.set("theme", "bootstrap-5");

Did you get it to work with this?

Yes, works perfectly.