Unselected item is returned as options only if event isn't prevented
This commit is contained in:
parent
ec97c818c8
commit
2059b5d4d3
12
select2.js
12
select2.js
@ -2988,12 +2988,6 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
return;
|
||||
}
|
||||
|
||||
while((index = indexOf(this.id(data), val)) >= 0) {
|
||||
val.splice(index, 1);
|
||||
this.setVal(val);
|
||||
if (this.select) this.postprocessResults();
|
||||
}
|
||||
|
||||
var evt = $.Event("select2-removing");
|
||||
evt.val = this.id(data);
|
||||
evt.choice = data;
|
||||
@ -3003,6 +2997,12 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
return;
|
||||
}
|
||||
|
||||
while((index = indexOf(this.id(data), val)) >= 0) {
|
||||
val.splice(index, 1);
|
||||
this.setVal(val);
|
||||
if (this.select) this.postprocessResults();
|
||||
}
|
||||
|
||||
selected.remove();
|
||||
|
||||
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
|
||||
|
Loading…
x
Reference in New Issue
Block a user