diff --git a/src/selectize.jquery.js b/src/selectize.jquery.js index b04a80dfe..1e438fcda 100644 --- a/src/selectize.jquery.js +++ b/src/selectize.jquery.js @@ -138,9 +138,8 @@ $.fn.selectize = function(settings_user) { } instance = new Selectize($input, $.extend(true, {}, defaults, settings_element, settings_user)); - $input.data('selectize', instance); $input.addClass('selectized'); }); }; -$.fn.selectize.defaults = Selectize.defaults; \ No newline at end of file +$.fn.selectize.defaults = Selectize.defaults; diff --git a/src/selectize.js b/src/selectize.js index 8ea0b6de8..48b26013d 100644 --- a/src/selectize.js +++ b/src/selectize.js @@ -242,6 +242,8 @@ $.extend(Selectize.prototype, { if (settings.preload === true) { self.onSearchChange(''); } + + self.$input.data('selectize', self); }, /** @@ -1830,6 +1832,9 @@ $.extend(Selectize.prototype, { .attr({tabindex: revertSettings.tabindex}) .show(); + self.$control_input.removeData('grow'); + self.$input.removeData('selectize'); + $(window).off(eventNS); $(document).off(eventNS); $(document.body).off(eventNS);