I am using the Select2 plugin, but the built in search functionality doesn't work when the plugin is used with a jQuery modal dialog.
There's a new version of the fix bigwavesoftware gives for select2 4.0 from the github issue thread about this problem:
if ($.ui && $.ui.dialog && $.ui.dialog.prototype._allowInteraction) {
var ui_dialog_interaction = $.ui.dialog.prototype._allowInteraction;
$.ui.dialog.prototype._allowInteraction = function(e) {
if ($(e.target).closest('.select2-dropdown').length) return true;
return ui_dialog_interaction.apply(this, arguments);
};
}
This only needs to be run before any modal dialogs that will have select2 in them are created; you don't need to do anything special inside of the dialog options like in bigwavesoftware's solution.
#select2 #jquery #jqueryselect2 #modal #ui #dialog #dialogs
0 komentar