From 7fcd58e1f7b3a6f133c7253615476c92d2379d47 Mon Sep 17 00:00:00 2001 From: Ivan Tanev Date: Wed, 3 Oct 2018 13:49:40 +0300 Subject: [PATCH] Fix new hide_results_on_select behavior should only be applied on mouse result selection --- coffee/chosen.jquery.coffee | 2 +- coffee/chosen.proto.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 614eaad61df..1a99fdb0f57 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -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("") diff --git a/coffee/chosen.proto.coffee b/coffee/chosen.proto.coffee index 41f53a3f25b..d11dc963279 100644 --- a/coffee/chosen.proto.coffee +++ b/coffee/chosen.proto.coffee @@ -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 = ""