I'm trying to use select2 jQuery plugin to enhance a select
element in HTML app. The select allow to choose multiple items.
I'll like to remove the items that are currently selected from the dropdown. I didn't find explicit solution in the docs.
The current solution I've found was to use templateResult
option and have the template function return null
if the item is selected. This cause Results.prototype.template
function to set container.style.display = 'none'
but this has the side-effect of causing the keyboard to still select those items even though they are not visible.