mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1490358
- Hide menu popup when press the ctrl+t. r=birtles
If push the ctrl+t, browser will open the new tab. In this case, the XUL popup panel doesn't hide automatically(autohide=false). As the result of it, the popup menu will be displayed in the new tab content. So this patch will hide the popup when receiving the ctr+t shortcut in the MenuButton. Differential Revision: https://phabricator.services.mozilla.com/D8809 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d5a153395f
commit
856268ab66
@ -15,6 +15,8 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
const { button } = dom;
|
||||
const { HTMLTooltip } = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
|
||||
|
||||
const isMacOS = Services.appinfo.OS === "Darwin";
|
||||
|
||||
loader.lazyRequireGetter(this, "createPortal", "devtools/client/shared/vendor/react-dom", true);
|
||||
|
||||
// Return a copy of |obj| minus |fields|.
|
||||
@ -346,6 +348,16 @@ class MenuButton extends PureComponent {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "t":
|
||||
if (isMacOS && e.metaKey || !isMacOS && e.ctrlKey) {
|
||||
// Close the menu if the user opens a new tab while it is still open.
|
||||
//
|
||||
// Bug 1499271: Once toolbox has been converted to XUL we should watch
|
||||
// for the 'visibilitychange' event instead of explicitly looking for
|
||||
// Ctrl+T.
|
||||
this.hideMenu();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user