Skip to content

Commit 9187ab0

Browse files
committed
Merge pull request select2#1859 from mxab/master
fixed invalid index in buildChangeDetails, fixes select2#1858
2 parents cb7aefa + 2d13c0a commit 9187ab0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

select2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3005,7 +3005,9 @@ the specific language governing permissions and limitations under the Apache Lic
30053005
for (var j = 0; j < old.length; j++) {
30063006
if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
30073007
current.splice(i, 1);
3008-
i--;
3008+
if(i>0){
3009+
i--;
3010+
}
30093011
old.splice(j, 1);
30103012
j--;
30113013
}

0 commit comments

Comments
 (0)