json-editor
json-editor copied to clipboard
Allow new value in enum : select2 tags like
Hello,
I would like to have something like that "tags" options in select2.
This means, the user can select from pre-existing options (defined in my "enum") or create a new tag by picking the first choice, which is what the user has typed into the search box so far.
But I can't figure out how to do this, is there a way ?
Here is my json: "Organization": { "type": "array", "format": "select", "items": { "type": "string", "enum": [ "Organization 1", "Organization 2", "Organization 3" ] }, "uniqueItems": true, "predefinedtype": "Organization", "title": "Organization" }
This json makes me a nice select2 box with multiple choice allowed, but it won't let me add a custom choice.
I tried to had: "options": { "select2_options": {"tags": true} }
But then I get an error : Option 'tags' is not allowed for Select2 when attached to a < select > element.
Hope it's clear !
Thanks.
got same issue with no resolution yet lol.. You found a fix?