Skip to content

Commit 91ee3fb

Browse files
author
scottjehl
committed
Merge remote branch 'origin/master'
2 parents 0648247 + 179061a commit 91ee3fb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/jquery.mobile.forms.select.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,14 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
422422
});
423423
}
424424

425-
self.menuPage.one('pageshow',focusMenuItem);
425+
self.menuPage.one('pageshow', function() {
426+
// silentScroll() is called whenever a page is shown to restore
427+
// any previous scroll position the page may have had. We need to
428+
// wait for the "silentscroll" event before setting focus to avoid
429+
// the browser's "feature" which offsets rendering to make sure
430+
// whatever has focus is in view.
431+
$(window).one("silentscroll", function(){ focusMenuItem(); });
432+
});
426433

427434
self.menuType = "page";
428435
self.menuPageContent.append( self.list );

0 commit comments

Comments
 (0)