diff --git a/src/selectize.js b/src/selectize.js index 14d5af64a..2f968dd5d 100644 --- a/src/selectize.js +++ b/src/selectize.js @@ -156,7 +156,7 @@ $.extend(Selectize.prototype, { keypress : function() { return self.onKeyPress.apply(self, arguments); }, resize : function() { self.positionDropdown.apply(self, []); }, blur : function() { return self.onBlur.apply(self, arguments); }, - focus : function() { return self.onFocus.apply(self, arguments); } + focus : function() { self.ignoreBlur = false; return self.onFocus.apply(self, arguments); } }); $document.on('keydown' + eventNS, function(e) { @@ -526,6 +526,14 @@ $.extend(Selectize.prototype, { self.isFocused = false; if (self.ignoreFocus) return; + // necessary to prevent IE closing the dropdown when the scrollbar is clicked + if (!self.ignoreBlur && document.activeElement === self.$dropdown_content[0]) { + self.ignoreBlur = true; + self.onFocus(e); + + return; + } + if (self.settings.create && self.settings.createOnBlur) { self.createItem(false); }