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

Fix for issues/1595 #1971

Closed
wants to merge 3 commits into from
Closed

Fix for issues/1595 #1971

wants to merge 3 commits into from

Conversation

ll-lm
Copy link
Contributor

@ll-lm ll-lm commented Jun 17, 2014

It makes possible search with 'group_search:false' option and print group's label instead 'undefined'

@@ -166,6 +166,9 @@ class AbstractChosen

else if option.group_array_index? and @results_data[option.group_array_index].search_match
option.search_match = true
if option.group and not @group_search
option.search_text = option.label
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather move the definition of option.search_text before the unless line, to avoid duplicating it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, thanks

@@ -149,7 +149,8 @@ class AbstractChosen
results_group = @results_data[option.group_array_index]
results += 1 if results_group.active_options is 0 and results_group.search_match
results_group.active_options += 1


option.search_text = option.label
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should move the line option.search_text = if option.group then option.label else option.text which is a bit below instead of adding a different definition of the property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is my inattention, sorry. Done :-)

@pfiller
Copy link
Contributor

pfiller commented Mar 4, 2015

This commit got behind master due to the fact that it's been open since June. Sorry about that.

The new PR #2255 contains the fix and credits @k-zelenkov. Thanks!

@pfiller pfiller closed this Mar 4, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants