From ddb2b6f7af028239f21645184eada5c61fc33e2b Mon Sep 17 00:00:00 2001 From: Lukas Slavicek Date: Tue, 18 Feb 2014 14:22:09 +0100 Subject: [PATCH] Fix bug #182 (use fix from https://github.com/bbc-fm-nk-core-eng/selectize.js/commit/ea3f0676730a2f52b7e245a1b2215d3a9498f371) --- src/selectize.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); }