Skip to content
New issue

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

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

Already on GitHub? # to your account

Skip highlight when holding the meta key. #2900

Merged
merged 1 commit into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class Chosen extends AbstractChosen
this.single_set_selected_text(this.choice_label(item))

if @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey))
this.winnow_results()
this.winnow_results(skip_highlight: true)
else
this.results_hide()
this.show_search_field_default()
Expand Down
2 changes: 1 addition & 1 deletion coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class @Chosen extends AbstractChosen
this.single_set_selected_text(this.choice_label(item))

if @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey))
this.winnow_results()
this.winnow_results(skip_highlight: true)
else
this.results_hide()
this.show_search_field_default()
Expand Down
4 changes: 2 additions & 2 deletions coffee/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class AbstractChosen
else
this.results_show()

winnow_results: ->
winnow_results: (options) ->
this.no_results_clear()

results = 0
Expand Down Expand Up @@ -214,7 +214,7 @@ class AbstractChosen
this.no_results query
else
this.update_results_content this.results_option_build()
this.winnow_results_set_highlight()
this.winnow_results_set_highlight() unless options?.skip_highlight

get_search_regex: (escaped_search_string) ->
regex_string = if @search_contains then escaped_search_string else "(^|\\s|\\b)#{escaped_search_string}[^\\s]*"
Expand Down