From 5285c152c945cd85ab3e32c36aff9c57f3fb5d35 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Wed, 12 Oct 2016 01:47:50 +0200 Subject: [PATCH] do not clear search text on multi selection (#2709) fixes #2549 --- coffee/chosen.jquery.coffee | 5 +++-- coffee/chosen.proto.coffee | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 969c2c20425..f3009d46042 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -359,8 +359,9 @@ class Chosen extends AbstractChosen else this.single_set_selected_text(this.choice_label(item)) - this.results_hide() unless @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey)) - this.show_search_field_default() + unless @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey)) + this.results_hide() + this.show_search_field_default() this.trigger_form_field_change selected: @form_field.options[item.options_index].value if @is_multiple || @form_field.selectedIndex != @current_selectedIndex @current_selectedIndex = @form_field.selectedIndex diff --git a/coffee/chosen.proto.coffee b/coffee/chosen.proto.coffee index 8803a3aea85..70bd97fda39 100644 --- a/coffee/chosen.proto.coffee +++ b/coffee/chosen.proto.coffee @@ -350,8 +350,9 @@ class @Chosen extends AbstractChosen else this.single_set_selected_text(this.choice_label(item)) - this.results_hide() unless @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey)) - this.show_search_field_default() + unless @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey)) + this.results_hide() + this.show_search_field_default() this.trigger_form_field_change() if @is_multiple || @form_field.selectedIndex != @current_selectedIndex @current_selectedIndex = @form_field.selectedIndex