Kristian Ashton
Kristian Ashton

Reputation: 47

Selectize.js only finds options with words that start with the given string

I am experiencing an annoying issue with the latest Selectize (currently 0.15.2). Whenever I type in the dropdown to search for entries, I only ever get entries that match according to the start of a word within the option but I need to search within the entire option strings. (This is especially important for German texts because we tend to join words together and so the search string may indeed not be at the start of the option text.) Has anyone else had this and fixed it?

The same issue was reported here: Selectize finds only the words that start with the given string however I do not want to use the CDN but have instead downloaded the latest Selectize as suggested on their website.

Thanks.

Upvotes: -1

Views: 43

Answers (1)

Kristian Ashton
Kristian Ashton

Reputation: 47

I have just found the solution (which unfortunately was not a documented on the Selectize web page). There is an undocumented configuration option for Selectize called "respect_word_boundaries". If, upon initialising an Selectize element you set "respect_word_boundaries: false", then the search is within the entire strings. Hope that helps anyone having the same issue! Cheers, Kristian.

Upvotes: 0

Related Questions