Skip to content
Snippets Groups Projects
Commit 7067b0d9 authored by Dão Gottwald's avatar Dão Gottwald
Browse files

Bug 463635 - All Tabs search doesn't always update on Enter. r=gavin

parent 0284ad8e
No related branches found
No related tags found
No related merge requests found
......@@ -617,8 +617,12 @@ var ctrlTab = {
case "keydown":
case "keyup":
if (event.target == this.searchField) {
if (event.keyCode == event.DOM_VK_RETURN)
this.panel.focus();
if (event.keyCode == event.DOM_VK_RETURN) {
// If there's a pending search, kick it off now.
if (this.searchField._timer)
this.search();
this.selectThumbnail();
}
} else {
// Manually consume the events, as the panel is open but doesn't
// necessarily have focus.
......
......@@ -91,7 +91,18 @@ function test() {
ok(isOpen(),
"panel is sticky after focusing the search field and releasing the Ctrl key");
ctrlTab.searchField.value = "foo";
EventUtils.synthesizeKey("f", {});
EventUtils.synthesizeKey("o", {});
EventUtils.synthesizeKey("o", {});
is(ctrlTab.searchField.value, "foo",
"text entered into search field");
EventUtils.synthesizeKey("VK_RETURN", {});
ok(isOpen(),
"Enter key kicks pending search off; the panel stays open as there's no match");
is(ctrlTab.searchField.value, "foo",
"search field value persists after Enter pressed");
EventUtils.synthesizeKey("VK_ESCAPE", {});
is(ctrlTab.searchField.value, "",
"ESC key clears the search field");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment