Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
how to allow duplicate selections #3341
Is there a way for select2 v3.5.x to allow selecting the same item multiple times?
It seems the default behavior (which is probably the most common use case) is to remove the selected item from the dropdown list. But I'd like to keep the item in the dropdown list and be able to add more duplicates of the same item.
@kevin-brown thanks for the response. But allowing duplicate IDs is not necessarily the feature I was looking for.
I was hoping that when clicking on a selection in the drop down, that selection would not disappear, but rather, you could select that option multiple times.
Simply adding duplicate options into the select tag is not the feature I'm inquiring about.
I think with select2 4.x, maybe a plugin could be written to support this? I'm trying to see if this would be a 'simple' change or a pretty involved change.
In order to allow for a selection to be made more than once, Select2 needs to allow for the
If you want to select something multiple times, there is going to have to be multiple options in the select tag. If there wasn't, the server would only know about the first selection, which sorta defeats the purpose of duplicate selections.
Select2 allows for multiple selections to be made with the same
You can actually do this without much effort by closing the
This appears to be more of a usage question than a bug report or common feature request. As we continue to keep the Select2 issue tracker geared towards these two areas, bug reports and common feature requests, we are redirecting usage questions to other communities such as the mailing list, IRC, or Stack Overflow.