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

Unified Diff: ui/webui/resources/js/cr/ui/page_manager/page.js

Issue 862403006: extensions: fix focus management for all dialogs (not just options). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@classList-fix
Patch Set: toggle Created 5 years, 10 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
Index: ui/webui/resources/js/cr/ui/page_manager/page.js
diff --git a/ui/webui/resources/js/cr/ui/page_manager/page.js b/ui/webui/resources/js/cr/ui/page_manager/page.js
index 3f41981b6f1f9b3a00bd36f3b2c52374680224f8..f0aff3a9bc441cd963da0e8fe7d2e920861cc57b 100644
--- a/ui/webui/resources/js/cr/ui/page_manager/page.js
+++ b/ui/webui/resources/js/cr/ui/page_manager/page.js
@@ -79,19 +79,7 @@ cr.define('cr.ui.pageManager', function() {
* strategy.
*/
focus: function() {
- // Do not change focus if any control on this page is already focused.
- if (this.pageDiv.contains(document.activeElement))
- return;
-
- var elements = this.pageDiv.querySelectorAll(
- 'input, list, select, textarea, button');
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- // Try to focus. If fails, then continue.
- element.focus();
- if (document.activeElement == element)
- return;
- }
+ cr.ui.setInitialFocus(this.pageDiv);
},
/**

Powered by Google App Engine
This is Rietveld 408576698