Bug 1519087 - Use preventDefault() on DevTools settings shortcut r=nchevobbe
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 17 May 2019 11:53:16 +0000
changeset 474319 fb21a998b3272f9947df63ba9acd9cd016571371
parent 474318 a9deeecc3899b5d21081a8408404c2fd60805787
child 474320 5a1c37d11ebc5ced51587ed936abb38ff788ec43
push id36027
push usershindli@mozilla.com
push dateFri, 17 May 2019 16:24:38 +0000
treeherdermozilla-central@c94c54aff466 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1519087
milestone68.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 1519087 - Use preventDefault() on DevTools settings shortcut r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D31358
devtools/client/framework/toolbox.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -2447,25 +2447,29 @@ Toolbox.prototype = {
 
     return promise.resolve();
   },
 
   /**
    * Toggles the options panel.
    * If the option panel is already selected then select the last selected panel.
    */
-  toggleOptions: function() {
+  toggleOptions: function(event) {
     // Flip back to the last used panel if we are already
     // on the options panel.
     if (this.currentToolId === "options" &&
         gDevTools.getToolDefinition(this.lastUsedToolId)) {
       this.selectTool(this.lastUsedToolId, "toggle_settings_off");
     } else {
       this.selectTool("options", "toggle_settings_on");
     }
+
+    // preventDefault will avoid a Linux only bug when the focus is on a text input
+    // See Bug 1519087.
+    event.preventDefault();
   },
 
   /**
    * Tells the target tab to reload.
    */
   reloadTarget: function(force) {
     if (this.target.canRewind) {
       // Recording tabs need to be reloaded in a new content process.