Skip to content

Commit 0160b36

Browse files
committed
missed one place where id is accessed. issue select2#51
1 parent bf5e7d1 commit 0160b36

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

select2.js

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
Copyright 2012 Igor Vaynberg
33
44
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in
@@ -484,6 +484,7 @@
484484
});
485485
query.callback(data);
486486
});
487+
// this is needed because inside val() we construct choices from options and there id is hardcoded
487488
opts.id=function(e) { return e.id; };
488489
} else {
489490
if (!("query" in opts)) {
@@ -1303,7 +1304,7 @@
13031304
throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
13041305
}
13051306

1306-
index = indexOf(selected.data("select2-data").id, val);
1307+
index = indexOf(this.id(selected.data("select2-data")), val);
13071308

13081309
if (index >= 0) {
13091310
val.splice(index, 1);

0 commit comments

Comments
 (0)