Explorar o código

support null, undefined, false for data() to unselect. fixes #273

Igor Vaynberg %!s(int64=13) %!d(string=hai) anos
pai
achega
f2460a826e
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      select2.js

+ 1 - 0
select2.js

@@ -2077,6 +2077,7 @@
                      .map(function() { return $(this).data("select2-data"); })
                      .get();
             } else {
+                if (!values) { values = []; }
                 ids = $.map(values, function(e) { return self.opts.id(e)});
                 this.setVal(ids);
                 this.updateSelection(values);