Skip to content

Commit

Permalink
do not clear search text on multi selection (#2709)
Browse files Browse the repository at this point in the history
fixes #2549
  • Loading branch information
koenpunt committed Oct 11, 2016
1 parent ec1a1fd commit 5285c15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5285c15

Please # to comment.