Skip to content
This repository

Search cant handle spaces in search string. #573

Closed
pursual opened this Issue · 9 comments

8 participants

pursual Lucas Jenß Marc Romain Beauxis Kristian Mandrup Zohar Babin Ken Earley
pursual

Can we modify the searching to be able to match spaces? For example if the select contains:

"front door" than typing "front door" in the search should match.

Lucas Jenß
x3ro commented

This seems to work, at least it does in the examples. E.g. typing American Sa in the first dropdown correctly finds American Samoa.

Marc

In general: +1 for this, because sometimes I have this issue, too.

On the other hand it's not all the time, there are cases where everything works fine and as expected.

It seems to depend on a specific whitespace character. Let's dig a bit deeper!

pursual

+1 on this. I simply cannot make it work.

Romain Beauxis
toots commented

Here's what I have observed: say you have option "Foo Bar Lol".

  • Typing "Foo B" works
  • Typing "Bar L" does not

in other words, spaces break option matching when the match does not include the beginning of the option string.

Will dig through that.

Romain Beauxis
toots commented

Alright folks, that wasn't too long..!

There is an undocumented option that fixes at least my issue:

$("...").chosen({search_contains: true})
Kristian Mandrup

You should document all the chosen options in the README or in the wiki as you add/change them IMO.

Zohar Babin

This :

$("...").chosen({search_contains: true})

fixed my issue - it was consistent on not searching more than 1 word.

Thanks!

Ken Earley
Owner

Sorry for such a late follow up. We are now working to get Chosen cleaned up and write better documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.