When user selects many items (tags), they are automatically sorted alphabetically. How to prevent automatic sort and keep user\'s order using Select2 4.0?
Update:
This solution works best
HTML
two four six
JS
$(document).ready( function () { $("select").select2({ tags: true }); $("select").on("select2:select", function (evt) { var element = evt.params.data.element; var $element = $(element); $element.detach(); $(this).append($element); $(this).trigger("change"); }); } );