diff --git a/src/ajax-chosen.coffee b/src/ajax-chosen.coffee index d2e960b..64e040f 100644 --- a/src/ajax-chosen.coffee +++ b/src/ajax-chosen.coffee @@ -29,9 +29,17 @@ do ($ = jQuery) -> @search_field = @element.next('.chosen-container') .find(".search-field > input, .chosen-search > input") + @ignore_input = false @register_observers() register_observers: -> + @search_field.on "compositionstart", (evt) => + @ignore_input = true + return + @search_field.on "compositionend", (evt) => + @ignore_input = false + @update_list(evt) + return @search_field.keyup (evt) => @update_list(evt); return @search_field.focus (evt) => @search_field_focused(evt); return @@ -39,6 +47,7 @@ do ($ = jQuery) -> return @update_list(evt) if @options.minTermLength == 0 and @search_field.val().length == 0 update_list: (evt) -> + return if @ignore_input # This code will be executed every time the user types a letter # into the input form that chosen has created