Skip to content

Commit 9a1a59f

Browse files
committed
Merge pull request harvesthq#1705 from harvesthq/remove-default-text-after-selection
Properly toggle `default` class on multi-Chosen
2 parents 8325fe6 + 4f23b16 commit 9a1a59f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

coffee/chosen.jquery.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,7 @@ class Chosen extends AbstractChosen
359359
this.single_set_selected_text(this.choice_label(item))
360360

361361
this.results_hide() unless (evt.metaKey or evt.ctrlKey) and @is_multiple
362-
363-
@search_field.val ""
362+
this.show_search_field_default()
364363

365364
@form_field_jq.trigger "change", {'selected': @form_field.options[item.options_index].value} if @is_multiple || @form_field.selectedIndex != @current_selectedIndex
366365
@current_selectedIndex = @form_field.selectedIndex

coffee/chosen.proto.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,7 @@ class @Chosen extends AbstractChosen
352352
this.single_set_selected_text(this.choice_label(item))
353353

354354
this.results_hide() unless (evt.metaKey or evt.ctrlKey) and @is_multiple
355-
356-
@search_field.value = ""
355+
this.show_search_field_default()
357356

358357
@form_field.simulate("change") if typeof Event.simulate is 'function' && (@is_multiple || @form_field.selectedIndex != @current_selectedIndex)
359358
@current_selectedIndex = @form_field.selectedIndex

0 commit comments

Comments
 (0)