Skip to content

Commit 915cdd7

Browse files
committed
FIX IE: Refreshing position before focusing the element.
Prevents IE from scrolling to the focused element before it is in position. Signed-off-by: Philipp C. Adrian <philippcadrian@greenish.ch>
1 parent 40b8920 commit 915cdd7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,14 @@ $.widget("ui.selectmenu", {
508508
this.list.appendTo('body');
509509
}
510510
this.list.addClass(self.widgetBaseClass + '-open')
511-
.attr('aria-hidden', false)
512-
.find('li:not(.' + self.widgetBaseClass + '-group):eq(' + this._selectedIndex() + ') a')[0].focus();
511+
.attr('aria-hidden', false);
512+
// (Philipp C. Adrian) FIX IE: Refreshing position before focusing the element.
513+
// Prevents IE from scrolling to the focused element before it is in position.
514+
this._refreshPosition();
515+
this.list.find('li:not(.' + self.widgetBaseClass + '-group):eq(' + this._selectedIndex() + ') a')[0].focus();
513516
if ( this.options.style == "dropdown" ) {
514517
this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top');
515518
}
516-
this._refreshPosition();
517519
this._trigger("open", event, this._uiHash());
518520
}
519521
},

0 commit comments

Comments
 (0)