mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
Bug 463635 - All Tabs search doesn't always update on Enter. r=gavin
This commit is contained in:
parent
0284ad8e37
commit
7067b0d947
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user