diff options
author | mohsen@chromium.org <mohsen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 00:49:47 +0000 |
---|---|---|
committer | mohsen@chromium.org <mohsen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 00:49:47 +0000 |
commit | 566c5b4c733240f6dd4fbea3602ef777fafc213b (patch) | |
tree | b823f0f0167b879d7f1b37570a123aaf704fc547 /ui/webui | |
parent | f1b5451d5f01e91a0c8a55cd4c9ad5a55d98a4cf (diff) | |
download | chromium_src-566c5b4c733240f6dd4fbea3602ef777fafc213b.zip chromium_src-566c5b4c733240f6dd4fbea3602ef777fafc213b.tar.gz chromium_src-566c5b4c733240f6dd4fbea3602ef777fafc213b.tar.bz2 |
Deactivate active element when clicking non-focusable button in WebUI
In some WebUI pages, buttons are non-focusable. When clicked, they
should not gain focus, but the currently selected element should lose
focus. The latter part was not working where the clicked button and previously
selected element are in different iframes. Here, it is fixed.
This bug is a regression caused by r210973.
BUG=262285
Review URL: https://chromiumcodereview.appspot.com/21108002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/webui')
-rw-r--r-- | ui/webui/resources/js/cr/ui/focus_manager.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/webui/resources/js/cr/ui/focus_manager.js b/ui/webui/resources/js/cr/ui/focus_manager.js index 1ed2c47..caa0454 100644 --- a/ui/webui/resources/js/cr/ui/focus_manager.js +++ b/ui/webui/resources/js/cr/ui/focus_manager.js @@ -201,6 +201,10 @@ cr.define('cr.ui', function() { type == 'radio' || type == 'checkbox') { if (document.activeElement != node) document.activeElement.blur(); + + // Focus the current window so that if the active element is in another + // window, it is deactivated. + window.focus(); event.preventDefault(); } }, false); |