diff --git a/select2.css b/select2.css index 4fc4427e..fdb0c607 100644 --- a/select2.css +++ b/select2.css @@ -114,25 +114,18 @@ Version: @@ver@@ Timestamp: @@timestamp@@ cursor: pointer; } -.select2-drop-undermask { - border: 0; - margin: 0; - padding: 0; - position: absolute; - left: 0; - top: 0; - z-index: 9998; - background-color: transparent; - filter: alpha(opacity=0); -} - .select2-drop-mask { border: 0; margin: 0; padding: 0; - position: absolute; + position: fixed; left: 0; top: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + opacity: 0; z-index: 9998; /* styles required for IE to work */ background-color: #fff; diff --git a/select2.js b/select2.js index 37c56f74..69c304ab 100644 --- a/select2.js +++ b/select2.js @@ -1262,7 +1262,7 @@ the specific language governing permissions and limitations under the Apache Lic if (self.opts.selectOnBlur) { self.selectHighlighted({noFocus: true}); } - self.close(); + self.close({focus:false}); e.preventDefault(); e.stopPropagation(); } @@ -1279,9 +1279,7 @@ the specific language governing permissions and limitations under the Apache Lic this.dropdown.attr("id", "select2-drop"); // show the elements - maskCss=_makeMaskCss(); - - mask.css(maskCss).show(); + mask.show(); this.dropdown.show(); this.positionDropdown(); @@ -1293,18 +1291,11 @@ the specific language governing permissions and limitations under the Apache Lic var that = this; this.container.parents().add(window).each(function () { $(this).on(resize+" "+scroll+" "+orient, function (e) { - var maskCss=_makeMaskCss(); - $("#select2-drop-mask").css(maskCss); that.positionDropdown(); }); }); - function _makeMaskCss() { - return { - width : Math.max(document.documentElement.scrollWidth, $(window).width()), - height : Math.max(document.documentElement.scrollHeight, $(window).height()) - } - } + }, // abstract @@ -1835,11 +1826,16 @@ the specific language governing permissions and limitations under the Apache Lic }, // single - close: function () { + close: function (params) { if (!this.opened()) return; this.parent.close.apply(this, arguments); + + params = params || {focus: true}; this.focusser.removeAttr("disabled"); - this.focusser.focus(); + + if (params.focus) { + this.focusser.focus(); + } }, // single