Skip to content

Commit

Permalink
Fix new hide_results_on_select behavior should only be applied on mou…
Browse files Browse the repository at this point in the history
…se result selection
  • Loading branch information
VanTanev committed Oct 3, 2018
1 parent d719289 commit 7fcd58e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,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))
if evt.metaKey or evt.ctrlKey or !@hide_results_on_select
if evt.metaKey or evt.ctrlKey or (!@hide_results_on_select && evt.originalEvent instanceof MouseEvent)
this.winnow_results(skip_highlight: true)
else
@search_field.val("")
Expand Down
2 changes: 1 addition & 1 deletion coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,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))
if evt.metaKey or evt.ctrlKey or !@hide_results_on_select
if evt.metaKey or evt.ctrlKey or (!@hide_results_on_select && evt instanceof MouseEvent)
this.winnow_results(skip_highlight: true)
else
@search_field.value = ""
Expand Down

0 comments on commit 7fcd58e

Please # to comment.