From 8faf6a948c38d215494c8bd5b79c7ccc681c3c39 Mon Sep 17 00:00:00 2001 From: Rob Campbell Date: Tue, 4 Jun 2013 15:09:00 -0400 Subject: [PATCH] Bug 873250 - Having enter select autocomplete is annoying; r=msucan --- .../browser_webconsole_bug_585991_autocomplete_keys.js | 8 ++++++-- browser/devtools/webconsole/webconsole.js | 8 ++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js b/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js index 6d53ca35275..56a3eb7dfb2 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js @@ -194,8 +194,12 @@ function testReturnKey() ok(!popup.isOpen, "popup is not open after VK_RETURN"); - is(inputNode.value, "window.foobarBug585991.valueOf", - "completion was successful after VK_RETURN"); + // modified by bug 873250 + is(inputNode.value, "", "no completion after VK_RETURN"); + isnot(jsterm.lastInputValue, "window.foobarBug585991.valueOf", + "lastInputValue is not window.foobarBug585991.valueOf"); + EventUtils.synthesizeKey("VK_UP", {}); + is(inputNode.value, jsterm.lastInputValue, "previous entry was lastInputNode") ok(!completeNode.value, "completeNode is empty"); diff --git a/browser/devtools/webconsole/webconsole.js b/browser/devtools/webconsole/webconsole.js index a1fc1923ff6..291d8531d16 100644 --- a/browser/devtools/webconsole/webconsole.js +++ b/browser/devtools/webconsole/webconsole.js @@ -3949,13 +3949,9 @@ JSTerm.prototype = { } break; + // Bug 873250 - always enter, ignore autocomplete case Ci.nsIDOMKeyEvent.DOM_VK_RETURN: - if (this.autocompletePopup.isOpen && this.autocompletePopup.selectedIndex > -1) { - this.acceptProposedCompletion(); - } - else { - this.execute(); - } + this.execute(); aEvent.preventDefault(); break;