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
Fix for issues/1595 #1971
Conversation
…roup'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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :-)
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! |
It makes possible search with 'group_search:false' option and print group's label instead 'undefined'