Skip to content

Commit

Permalink
Ensure data.id is a String in SelectAdapter select/unselect
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrowning committed Oct 15, 2018
1 parent 14a059d commit 43188aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/select2/data/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ define([
data.push.apply(data, currentData);

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

if ($.inArray(id, val) === -1) {
val.push(id);
Expand Down Expand Up @@ -90,7 +90,7 @@ define([
for (var d = 0; d < currentData.length; d++) {
var id = currentData[d].id;

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

0 comments on commit 43188aa

Please sign in to comment.