Chromium Code Reviews| Index: ui/webui/resources/js/action_link.js |
| diff --git a/ui/webui/resources/js/action_link.js b/ui/webui/resources/js/action_link.js |
| index 9d83ed727a749c6549186c6b12f6d46ce2448ce7..e5a991821bfc93ceb3d56b343b6bf92cc0971f91 100644 |
| --- a/ui/webui/resources/js/action_link.js |
| +++ b/ui/webui/resources/js/action_link.js |
| @@ -54,6 +54,12 @@ var ActionLink = document.registerElement('action-link', { |
| } |
| }); |
| + this.addEventListener('keyup', function(e) { |
| + // If focus started via Tab press, allow outline to show. |
| + if (e.key === 'Tab') |
|
Dan Beam
2017/03/22 03:28:53
this isn't the only way focus can get to an elemen
|
| + this.classList.remove('no-outline'); |
| + }); |
| + |
| function preventDefault(e) { |
| e.preventDefault(); |
| } |
| @@ -70,16 +76,10 @@ var ActionLink = document.registerElement('action-link', { |
| document.addEventListener('selectstart', preventDefault); |
| document.addEventListener('mouseup', removePreventDefault); |
| - // If focus started via mouse press, don't show an outline. |
| + // If focus started via mouse press, suppress outline. |
| if (document.activeElement != this) |
| this.classList.add('no-outline'); |
| }); |
| - |
| - this.addEventListener('blur', function(e) { |
| - // This check helps us exclude external events like application switch. |
| - if (e.sourceCapabilities) |
| - this.classList.remove('no-outline'); |
| - }); |
| }, |
| /** @type {boolean} */ |