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

html encoded values is not finding search match #2248

Closed
dibiancoj opened this issue Feb 26, 2015 · 9 comments
Closed

html encoded values is not finding search match #2248

dibiancoj opened this issue Feb 26, 2015 · 9 comments

Comments

@dibiancoj
Copy link

I have a select list item where the text displayed for an option is "E&O". When searched we never find a match.

In Chosen.prototype.get_search_text return $('

').text($.trim(this.search_field.val())).html();

I believe we should be returning .text() instead of .html(). This way we aren't searching for html encoded items.

@pfiller
Copy link
Contributor

pfiller commented Mar 4, 2015

I think this is fixed now as a result of #2254. Please re-open with a link to a fiddle if you're still seeing the problem after upgrading.

@pfiller pfiller closed this as completed Mar 4, 2015
@dibiancoj
Copy link
Author

Still doesn't work. Type O. E&O should be returned. Fiddle is below.

https://jsfiddle.net/hpv4La79/4/

@adunkman
Copy link
Contributor

adunkman commented Mar 5, 2015

@dibiancoj that Fiddle doesn’t work! :)

@adunkman
Copy link
Contributor

adunkman commented Mar 5, 2015

I should be more clear. The fiddle throws a script error, and Chosen isn’t initialized.

@tjschuck
Copy link
Member

tjschuck commented Mar 5, 2015

Aha, not finding "E&O" for "O" is probably this instead: #1483

@dibiancoj
Copy link
Author

Try this link
http://jsfiddle.net/hpv4La79/6/

@adunkman
Copy link
Contributor

adunkman commented Mar 5, 2015

Looks like you’re just missing an option — search_contains: true.

See this updated fiddle: http://jsfiddle.net/hpv4La79/7/. I believe it now works as you’re expecting.

@dibiancoj
Copy link
Author

Actually let me pull the changes into my full solution with all my chosen and check if the change worked

@dibiancoj
Copy link
Author

Thanks for your help guys. Everything is working as expected!

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

4 participants