Im looking at upgrading our use of select2 to the latest version and I was trying to make it work like we were using earlier versions.
Basically my question is, I have a multi select that i attach select2 to, and when you select the item, it will put it in a “pill” and if you click the dropdown to expose the select options, I want the one selected to not be in the list.
I have a jsfiddle with a sample of what I am doing.
I was looking at the templateResult and in that callback I check to see if the option is selected. if it is, then I return null, otherwise i return the text property. This works, but previously, when you tried to select something and you have already selected all the options, it would display the “No results found” or whatever your noMatches message is set to. It shows up when you type something in the select field to search, but not when you try to expand the dropdown and all the options are selected.
What is the best way to handle this? Do i need to make a custom data adapter or ?
Thank you!