Pārlūkot izejas kodu

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

Remove duplicated options from multi-valued select boxes.
Igor Vaynberg 11 gadi atpakaļ
vecāks
revīzija
418a659adb
1 mainītis faili ar 1 papildinājumiem un 3 dzēšanām
  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();