Skip to content

Commit 418a659

Browse files
committed
Merge pull request select2#1678 from jdecuyper/feature-remove-duplicated-option
Remove duplicated options from multi-valued select boxes.
2 parents 856af79 + a380eba commit 418a659

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

select2.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,9 +2842,7 @@ the specific language governing permissions and limitations under the Apache Lic
28422842
return;
28432843
}
28442844

2845-
index = indexOf(this.id(data), val);
2846-
2847-
if (index >= 0) {
2845+
while((index = indexOf(this.id(data), val)) >= 0) {
28482846
val.splice(index, 1);
28492847
this.setVal(val);
28502848
if (this.select) this.postprocessResults();

0 commit comments

Comments
 (0)