问题
is there a better way to close select2 when you click away? I have it closing with
$(document).click(function(event) {
if(!$(event.target).hasClass("select2-selection__rendered") &&
!$(event.target).hasClass("select2-results__option")) {
$("#e1").select2('close');
}
});
but that seems weird.
here is the fiddle http://jsfiddle.net/jEADR/5557/
来源:https://stackoverflow.com/questions/49466671/closing-select2-on-click-away-when-closeonselect-is-false