Menu icon Foundation
Conflict Select 2 With Reveal

Hi,

i have a problem with select2 and the plugin Jquery Reveal.

When i remove an item from select2 with property : multiple, the reveal modal closes.


Last method of select2 called before close the reveal modal.
Line 3074 of https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.js

SelectAdapter.prototype.unselect = function (data) {
var self = this;

if (!this.$element.prop('multiple')) {
return;
}

data.selected = false;

if ($(data.element).is('option')) {
data.element.selected = false;

this.$element.trigger('change');

return;
}

this.current(function (currentData) {
var val = [];

for (var d = 0; d < currentData.length; d++) {
var id = currentData[d].id;

if (id !== data.id && $.inArray(id, val) === -1) {
val.push(id);
}
}

self.$element.val(val);

self.$element.trigger('change');
});
};



Somebody  has already meet this problem ?

select2

Hi,

i have a problem with select2 and the plugin Jquery Reveal.

When i remove an item from select2 with property : multiple, the reveal modal closes.


Last method of select2 called before close the reveal modal.
Line 3074 of https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.js

SelectAdapter.prototype.unselect = function (data) {
var self = this;

if (!this.$element.prop('multiple')) {
return;
}

data.selected = false;

if ($(data.element).is('option')) {
data.element.selected = false;

this.$element.trigger('change');

return;
}

this.current(function (currentData) {
var val = [];

for (var d = 0; d < currentData.length; d++) {
var id = currentData[d].id;

if (id !== data.id && $.inArray(id, val) === -1) {
val.push(id);
}
}

self.$element.val(val);

self.$element.trigger('change');
});
};



Somebody  has already meet this problem ?

jinch over 2 years ago

I noticed an issue using select2 as well with but, with Foundations sticky. If you make the window small than large again after initial load your sticky will no longer be stuck (on chrome). If you remove the select2.js than this is no longer an issue so there must be a conflict between the js plugins somewhere.