I'm trying to use the tags in Select2. I want to give the user the ability to load some known tags and sometimes to add new, if he wants.
The problem is that Select2 give me the option to add new tags only in new SELECT field. If your'e preloading some data to the field and pre-selecting it - you are losing that ability.
Here there is an example of the problem: jsfiddle
$("#tags").select2({
multiple: true,
tags: true,
placeholder: "enter",
tokenSeparators: [','],
data: ['11']
});
//The problem is in the next line
//$('#tags').val(['11','22']).select2();
In the current state new tags are accepted. If you will remove the // in the last line you won't be able to add new tags. Any idea why?
Thanks!