Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Not working on white spaces #2838

Closed
PranitFifthdi opened this issue Jun 20, 2017 · 9 comments
Closed

Search Not working on white spaces #2838

PranitFifthdi opened this issue Jun 20, 2017 · 9 comments

Comments

@PranitFifthdi
Copy link

https://harvesthq.github.io/chosen/
above is the reference link how search works in chosen js.
If we start search from any position which has white space after some position, the search returns null.
Plz give me some solution

@Nate1024
Copy link

I'm having the same issue. It only seems to happen when the search terms are in the middle of the string. For instance, if you search for "black" or "American black" it will return results, but "black bear" returns null.

@mduffy215
Copy link

mduffy215 commented Aug 2, 2017

If one of my search items is "Austin Northwest" and another is "THW Waco". If I type "THW" I would expect both items to show up. If I type "THW " (with a space) I would expect to see just "THW Waco"; however, in v1.7.0 (latest on 2017-08-02) I see both items. This is probably a quick fix in a reg ex somewhere. Would you accept an Amazon gift card of $50 to do a quick fix? Thx for creating Chosen; it is the only way to do drop downs. mduffy215@gmail.com

@scott-census
Copy link

I'm having a similar problem. Some of the items in the list have a '<' sign (like <20M or <12Y). When I type < in the search box, all I see is the M or Y for each entry that contains a < (there are actually two spaces before each <, but if I type ' ' (space) no filtering takes place, which is fine in this case).

@tjschuck
Copy link
Member

tjschuck commented Aug 3, 2017

This should be fixed by #1483, which is merged to master but not yet in a released version. The next release will include it.

If you'd like to build Chosen yourself from source in the meantime, you can follow these instructions.

@tjschuck tjschuck closed this as completed Aug 3, 2017
@scott-census
Copy link

scott-census commented Aug 3, 2017 via email

@tjschuck
Copy link
Member

tjschuck commented Aug 3, 2017

@scott-census Aha, yes, that's both a different issue from this one (which is about whitespace/word boundaries) and something covered by a number of other issues. See #2548 and #2844 and a bunch of other issues about similar stuff. Feel free to add any feedback you have to those. According to #2548, you might be able to solve your problem by setting search_contains to false, but that might not be a tenable workaround for your specific case.

@scott-census
Copy link

scott-census commented Aug 3, 2017 via email

@mduffy215
Copy link

Great news! When is the next release? Is it possible to get on an email list for release notifications?

@tjschuck
Copy link
Member

tjschuck commented Aug 4, 2017

@mduffy215 New releases are posted to the releases page. You can't directly subscribe to get email notifications from that page, but it does have an RSS feed at https://github.com/harvesthq/chosen/releases.atom. If you use a feed reader, you can subscribe to that, or if you want to receive email updates when something new goes into the feed, you can use a service like IFTTT, which offers an RSS to email applet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants