Skip to content

Commit e0f854d

Browse files
committed
copy the args object so changes to it no longer effect other select2s. closes select2#47
1 parent 3b9840e commit e0f854d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@
14171417

14181418
this.each(function () {
14191419
if (args.length === 0 || typeof(args[0]) === "object") {
1420-
opts = args.length === 0 ? {} : args[0];
1420+
opts = args.length === 0 ? {} : $.extend({}, args[0]);
14211421
opts.element = $(this);
14221422

14231423
if (opts.element.get(0).tagName.toLowerCase() === "select") {

0 commit comments

Comments
 (0)