aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2011-04-16 15:52:31 +0200
committerFelix Nagel <info@felixnagel.com>2011-04-16 15:52:31 +0200
commit351b73989861d6d8cd1ec750aebc900779d9ab6e (patch)
tree320d429ee48ccb768726fa434609a3b590fa4e0a
parentf62637506dc2fa7f403163c1ff8d29b4c89687e3 (diff)
downloadjquery-ui-351b73989861d6d8cd1ec750aebc900779d9ab6e.tar.gz
jquery-ui-351b73989861d6d8cd1ec750aebc900779d9ab6e.zip
fixed: problem with focus and positioning in IE on slow machines, thanks to greenish, see https://github.com/fnagel/jquery-ui/pull/94
-rw-r--r--ui/jquery.ui.selectmenu.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index fc476956d..7c0f61a7a 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -507,13 +507,14 @@ $.widget("ui.selectmenu", {
} else {
this.list.appendTo('body');
}
- this.list.addClass(self.widgetBaseClass + '-open')
- .attr('aria-hidden', false)
- .find('li:not(.' + self.widgetBaseClass + '-group):eq(' + this._selectedIndex() + ') a')[0].focus();
+
+ this.list.addClass(self.widgetBaseClass + '-open').attr('aria-hidden', false);
+ // FIX IE: Refreshing position before focusing the element, prevents IE from scrolling to the focused element before it is in position.
+ this._refreshPosition();
+ this.list.find('li:not(.' + self.widgetBaseClass + '-group):eq(' + this._selectedIndex() + ') a')[0].focus();
if ( this.options.style == "dropdown" ) {
this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top');
}
- this._refreshPosition();
this._trigger("open", event, this._uiHash());
}
},