Jelajahi Sumber

Merge pull request #1678 from jdecuyper/feature-remove-duplicated-option

Remove duplicated options from multi-valued select boxes.
Igor Vaynberg 11 tahun lalu
induk
melakukan
418a659adb
1 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 1 3
      select2.js

+ 1 - 3
select2.js

@@ -2842,9 +2842,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 return;
             }
 
-            index = indexOf(this.id(data), val);
-
-            if (index >= 0) {
+            while((index = indexOf(this.id(data), val)) >= 0) {
                 val.splice(index, 1);
                 this.setVal(val);
                 if (this.select) this.postprocessResults();