I tryed to prevent select2 opening when clear button is pressed.
How to implement it?
j(".select").on("select2:select", function () { //register event for each click
var select = this;
j(".select2-selection__clear").mousedown(function (e) {
j(select).val(null).trigger("change");
e.stopPropagation();
})
});