Label Selector contains instead of starts-with

2
I would like to have the label selector search available labels usings contains, instead of starts with. For instance,  if a label value is, 'Internet: Google Search', I want the label to be found when the user types in 'google'.  Currently, finding this label requires the user to type in 'Internet' first.   Before I work on modifying the widget, just wanted to see if anyone has done this already. Thanks!
asked
1 answers
2

Hi Mike,

I doubt it's been done (it's not even a feature of the tagit library), but looks to be a trivial change. 

 

think it's here in the source code, and you'd change it from:

if (e.toLowerCase().indexOf(tag) == 0) {

to:

if (e.toLowerCase().includes(tag)) {

EDIT: just confirmed that this works. Would be awesome to add it as an option in the widget.

answered