Bug 1327972 - make sure alt/cmd+lefr/right navigate history even if devtools toolbar is focused. r=jryans
authorYura Zenevich <yzenevich@mozilla.com>
Wed, 18 Jan 2017 10:57:25 -0500
changeset 375157 d6f80f3a2400de5b75083485732e8f740cc006f3
parent 375156 118b9a68bb7e796e93d53d97fbdee00d6f72c24f
child 375158 a12e66cb7bc27c0b8e1822a86b3e91763011e211
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1327972
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1327972 - make sure alt/cmd+lefr/right navigate history even if devtools toolbar is focused. r=jryans MozReview-Commit-ID: 86Qhmtz4ODG
devtools/client/framework/toolbox.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -983,17 +983,24 @@ Toolbox.prototype = {
    * On left/right arrow press, attempt to move the focus inside the toolbar to
    * the previous/next focusable element. This is not in the React component
    * as it is difficult to coordinate between different component elements.
    * The components are responsible for setting the correct tabindex value
    * for if they are the focused element.
    * @param  {KeyboardEvent} event
    */
   _onToolbarArrowKeypress: function (event) {
-    let { key, target } = event;
+    let { key, target, ctrlKey, shiftKey, altKey, metaKey } = event;
+
+    // If any of the modifier keys are pressed do not attempt navigation as it
+    // might conflict with global shortcuts (Bug 1327972).
+    if (ctrlKey || shiftKey || altKey || metaKey) {
+      return;
+    }
+
     let buttons = [...this._componentMount.querySelectorAll("button")];
     let curIndex = buttons.indexOf(target);
 
     if (curIndex === -1) {
       console.warn(target + " is not found among Developer Tools tab bar " +
         "focusable elements.");
       return;
     }