modal close select2 is not a function code example
Example: enforcefocus select2 modal
// Do this before you initialize any of your modals
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
// Do this before you initialize any of your modals
$.fn.modal.Constructor.prototype.enforceFocus = function() {};