-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Change search_text
to use option.text
rather than option.html
#1638
Conversation
@kenearley Of the @harvesthq/chosen-developers, you probably know the most about Ember as far as I know. /cc @jkintscher, just because I know you've wrestled with Chosen + Ember. |
Okay, I'm surprised I didn't find that issue - strange. Okay good, I'll close this one then. |
@aexmachina Thanks for opening this PR. It's a good kick in the pants to get this fixed. With the popularity of Ember rising, it seems a worthwhile endeavor to make Chosen work more easily (especially if it comes at such a low cost). If @stof's comment on #1150 is right, this would certainly be merge-ready. |
That was certainly my impression as I worked through the source. |
Seems like this would be the solution to #1150, right? Since that's just an issue and this is an actual pull request, I'm going to re-open it as the Official Proposed Solution™, since some dupes are coming in now, like #1661. I'm also going to add this magic language which hopefully GitHub will pick up even though it's not by the official poster: Fixes #1150 |
Is this going to be merged any time soon? I just ran into this issue with emberjs. |
It seems like lots of people are having the same issue - I just filed an identical pull request to this (#1661). Any reason not to merge this? |
@tjschuck what needs to happen to get this merged? If there is anything needed, I will happily do it. This 4-character change has dragged on long enough, no? |
@alexspeller Sorry, I mostly just triage and police issues. The @harvesthq/chosen-developers need to give the final say. I think whether or not this is "safe" per the conversation on #1150 is the only outstanding thing that has kept this from being merged so far. |
Change `search_text` to use `option.text` rather than `option.html`
Release notes updated. |
Ember.js litters the DOM with
<script>
tags that are used to perform its DOM binding. So when using anEmber.Select
component with Chosen, searches would never return results because the regex binds to the start using/^...
, and the value ofoption.html
always starts with a<script>
tag - so it would never match the regex.This PR fixes the problem by searching on
option.text
. Another solution would be to change the regex to not bind to the start, but these seemed to be a less significant change.