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.8k stars 467 forks source link

Override Select2's containerCssClass? #1317

Closed dwasyl closed 1 year ago

dwasyl commented 1 year ago

Hi all,

I have a project where the select element is getting some css value that ultimately clash with select2 styling. The thing is those classes need to be assigned to any select that isn't Select2 so I've been looking at ways of changing what gets set when I ran across containerCssClass. This seems to be the perfect way to filter out any undesireable css classes, however, it seems to be set in select2.js:

            containerCssClass: ':all:',

Is this entirely hardcoded or is there a way to override this? data-* attributes don't seem to do the trick. If I need to have a local copy of select2.js that'll do, but gets potentially messy.

Thanks!

dwasyl commented 1 year ago

Alright, my own mistake, you can override it - I can't type.