Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: ui/webui/resources/js/cr/ui/menu_button.js

Issue 12091099: Move focusSelectedItem to the end of showMenu() as it can cause the page to scroll prematurely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/history/history.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/menu_button.js
diff --git a/ui/webui/resources/js/cr/ui/menu_button.js b/ui/webui/resources/js/cr/ui/menu_button.js
index bc86858ed1cefc7abddb849a4aeeebfb82e3ab92..0649f7d5020b2a1de10208df1879679979583790 100644
--- a/ui/webui/resources/js/cr/ui/menu_button.js
+++ b/ui/webui/resources/js/cr/ui/menu_button.js
@@ -162,8 +162,6 @@ cr.define('cr.ui', function() {
this.menu.hidden = false;
this.setAttribute('menu-shown', '');
- if (shouldSetFocus)
- this.menu.focusSelectedItem();
// When the menu is shown we steal all keyboard events.
var doc = this.ownerDocument;
@@ -174,6 +172,9 @@ cr.define('cr.ui', function() {
this.showingEvents_.add(win, 'resize', this);
this.showingEvents_.add(this.menu, 'activate', this);
this.positionMenu_();
+
+ if (shouldSetFocus)
+ this.menu.focusSelectedItem();
},
/**
« no previous file with comments | « chrome/browser/resources/history/history.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698