dragonofmercy / Tokenize2

Tokenize2 is a plugin which allows your users to select multiple items from a predefined list or ajax, using autocompletion as they type to find each item. You may have seen a similar type of text entry when filling in the recipients field sending messages on facebook or tags on tumblr.
https://dragonofmercy.github.io/Tokenize2/
BSD 3-Clause "New" or "Revised" License
83 stars 25 forks source link

Display the label of <optgroup> #53

Closed tommykamkcm closed 6 years ago

tommykamkcm commented 6 years ago

Hello, I would like to suggest a new feature. It's great that Tokenize2 also works on <select> with <optgroup>, however, it would be really good if we could make the label of <optgroup> to be sticky. For example:

Keyword: (empty string)
Dropdown UI:
**Fruit**
Apple
Banana
**Vegetable**
Lettuce
Spinach 

If I type App:

Keyword: App
Dropdown UI:
**Fruit**
Apple
**Vegetable**
No matches
dragonofmercy commented 6 years ago

I'm sorry but this modification is not possible yet with the event system choosed for this plugin. I suggest you to use this plugin instead: https://select2.org/getting-started/basic-usage#multi-select-boxes-pillbox

tommykamkcm commented 6 years ago

@zellerda thanks for your suggestion, however, I also need the drag to sort feature from your plugin as well. I reckon I will prepend the label of to every value for now. Thanks again!