diff --git a/chosen/chosen.jquery.js b/chosen/chosen.jquery.js index a0a5919..4efe36a 100644 --- a/chosen/chosen.jquery.js +++ b/chosen/chosen.jquery.js @@ -418,6 +418,7 @@ } this.results_hide(); this.search_field.val(""); + ($(this.form_field)).trigger("change"); return this.search_field_scale(); } }; @@ -436,9 +437,7 @@ result.removeClass("result-selected").addClass("active-result").show(); this.result_clear_highlight(); this.winnow_results(); - if (typeof Event.simulate === 'function') { - this.form_field.simulate("change"); - } + ($(this.form_field)).trigger("change"); return this.search_field_scale(); }; Chosen.prototype.results_search = function(evt) { diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 79c118d..1ea7baf 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -377,8 +377,7 @@ class Chosen this.results_hide() @search_field.val "" - # TODO - #@form_field.simulate("change") if typeof Event.simulate is 'function' + ($ @form_field).trigger "change" this.search_field_scale() result_activate: (el) -> @@ -398,7 +397,7 @@ class Chosen this.result_clear_highlight() this.winnow_results() - @form_field.simulate("change") if typeof Event.simulate is 'function' + ($ @form_field).trigger "change" this.search_field_scale() results_search: (evt) ->