From a380ebabd520e850807ed8bc722ffe018bfa5379 Mon Sep 17 00:00:00 2001 From: jdecuyper Date: Fri, 30 Aug 2013 18:16:41 -0500 Subject: [PATCH] Remove duplicated options from multi-valued select boxes. --- select2.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/select2.js b/select2.js index 3e9c929d..37abcec4 100644 --- a/select2.js +++ b/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();