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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 732253002: options: Fix focus "Show advanced settings..." click focus regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-settings-focus
Patch Set: Created 6 years, 1 month 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 | « no previous file | ui/webui/resources/js/cr/ui/focus_outline_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index c92fa1df42bc7c5c4bc0e7ca50512076fd3a49ad..f79eea4e5029a6782f70290ecee5dc152b01fa98 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -127,11 +127,11 @@ cr.define('options', function() {
$('advanced-settings'),
$('advanced-settings-container'));
- // If the link was focused (i.e., it was activated using the keyboard)
- // and it was used to show the section (rather than hiding it), focus
- // the first element in the container.
- if (document.activeElement === $('advanced-settings-expander') &&
- showAdvanced) {
+ // If the click was triggered using the keyboard and it showed the
+ // section (rather than hiding it), focus the first element in the
+ // container.
+ var manager = cr.ui.FocusOutlineManager.forDocument(document);
+ if (manager.visible && showAdvanced) {
var focusElement = $('advanced-settings-container').querySelector(
'button, input, list, select, a[href]');
if (focusElement)
« no previous file with comments | « no previous file | ui/webui/resources/js/cr/ui/focus_outline_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698