Skip to content

Commit

Permalink
Fix bug selectize#182 (use fix from bbc@ea3f067)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfox committed Feb 18, 2014
1 parent 0438a79 commit ddb2b6f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ddb2b6f

Please sign in to comment.