diff --git a/chosen.ajaxaddition.jquery.js b/chosen.ajaxaddition.jquery.js index 7549cbd..1debaa7 100644 --- a/chosen.ajaxaddition.jquery.js +++ b/chosen.ajaxaddition.jquery.js @@ -213,6 +213,11 @@ //backout if nothing is in input box if ($.trim(q).length < minLength) { input.get(0).style.background = inputBG; + var selected = $('option:selected', select).not(':empty').clone().attr('selected', true); + $('option', select).remove(); + + selected.appendTo(select); + select.trigger("chosen:updated"); if (throttle) { clearTimeout(throttle); } return false; }