瀏覽代碼

replace this.$element.val() with this.current()

Zubair 10 年之前
父節點
當前提交
1c8846079b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/js/select2/data/maximumSelectionLength.js

+ 1 - 1
src/js/select2/data/maximumSelectionLength.js

@@ -10,7 +10,7 @@ define([
   MaximumSelectionLength.prototype.query =
     function (decorated, params, callback) {
 
-    var count = this.$element.val() != null ? this.$element.val().length : 0;
+    var count = this.current() != null ? this.current().length : 0;
     if (count >= this.maximumSelectionLength) {
       this.trigger('results:message', {
         message: 'maximumSelected',