Browse Source

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

Igor Vaynberg 13 năm trước cách đây
mục cha
commit
f2460a826e
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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);