Thanks for the video, although it doesn’t really help me diagnose the problem. In this case, I would try to investigate why all of the options seem to become disabled after the initial selection (I’m guessing that’s what is happening, so perhaps that’s the first thing to confirm). You should be able to use your browser’s Inspect Element tool (in the Developer Tools) to inspect the actual generated <option>
elements in your <select>
, as well as look at the Select2 widget components (probably <div>
s, unless you’ve used a custom render template) that represent the <option>
s. It’s possible that the <option>
elements are being disabled (i.e., the disabled
attribute is being added to the <option>
elements in the DOM); it’s also possible that a CSS class is being set on the UI widget components that represent the <option>
elements, and that class makes the UI components unselectable. You should be able to investigate all of these possibilities using the Developer Tools to inspect the DOM elements for the various components I mentioned above, looking at their attributes as well as the CSS rules that apply to them.
Once you figure out why the options can’t be selected, the next step is to figure out what’s causing that change of state. Since you’re using an AJAX data source, note that the objects that represent the items in the select list have a disabled
property which, when set to true
, cause the items to be disabled. So you might also want to inspect your data items and see if there’s a disabled
property either coming from your data source or being set by something else afterwards. (One quick way to start looking for this stuff might be to simply do a text search in all of your JavaScript code for “disabled”.)
If none of that proves fruitful, then if possible perhaps you could disable some of the other libraries/frameworks you’re using on your site. Perhaps one of them does have some unexpected interaction with your Select2 widget.
Good luck, and please let me know if you resolve the issue.