Bug 1453894 - Give focus to console input when closing sidebar with Escape key; r=Honza.

MozReview-Commit-ID: J9y6XkmKJ43

--HG--
extra : rebase_source : 47b3c832cbadde8968527f17aa477148f3fa451a
This commit is contained in:
Nicolas Chevobbe 2018-04-16 10:23:39 +02:00
parent 5aeada7d94
commit 405ab44135
2 changed files with 3 additions and 0 deletions

View File

@ -255,6 +255,7 @@ NewWebConsoleFrame.prototype = {
shortcuts.on("Esc", event => {
if (!this.jsterm.autocompletePopup || !this.jsterm.autocompletePopup.isOpen) {
this.newConsoleOutput.dispatchSidebarClose();
this.jsterm.focus();
}
});
}

View File

@ -69,6 +69,8 @@ add_task(async function() {
await onSidebarShown;
sidebar = hud.ui.document.querySelector(".sidebar");
ok(!sidebar, "Sidebar hidden after sending esc");
let inputNode = hud.jsterm.inputNode;
ok(hasFocus(inputNode), "console input is focused after closing the sidebar");
});
async function showSidebar(hud) {