Select2 use duplicate tags



I would like to use the same tag multiple times to fit my data. Based on this answer here : I found this :

In select2 - 4.0.5 this is kind of working but I still go an error when unselecting :

Uncaught TypeError: Cannot read property 'remove' of undefined

What can I do to allow multiple select tags?

Thanks you


The code in the JSFiddle linked to the first answer to the StackOverflow post seems to work (I tried it, here: . However, it uses an old version of Select2, and my guess is that later versions do not support the approach that was used in the answer.

Do you get the error every time you unselect a tag, or only when you unselect a duplicate?

Can you post a sample of your code on or