mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1184220 - typing in the searchbar should de-select the settings or opensearch buttons at the bottom of the search panel, r=Gijs.
This commit is contained in:
parent
ca912b8eea
commit
d933cfc8ee
@ -1143,6 +1143,10 @@
|
||||
let isOneOffSelected =
|
||||
this.selectedButton &&
|
||||
this.selectedButton.classList.contains("searchbar-engine-one-off-item");
|
||||
// Typing de-selects the settings or opensearch buttons at the bottom
|
||||
// of the search panel, as typing shows the user intends to search.
|
||||
if (this.selectedButton && !isOneOffSelected)
|
||||
this.selectedButton = null;
|
||||
if (textbox.value) {
|
||||
self.removeAttribute("showonlysettings");
|
||||
groupText = headerSearchText.previousSibling.value +
|
||||
|
@ -152,6 +152,23 @@ add_task(function* test_arrows() {
|
||||
"the textfield value should be back to initial value");
|
||||
});
|
||||
|
||||
add_task(function* test_typing_clears_button_selection() {
|
||||
is(Services.focus.focusedElement, textbox.inputField,
|
||||
"the search bar should be focused"); // from the previous test.
|
||||
ok(!textbox.selectedButton, "no button should be selected");
|
||||
|
||||
EventUtils.synthesizeKey("VK_UP", {});
|
||||
is(textbox.selectedButton.getAttribute("anonid"), "search-settings",
|
||||
"the settings item should be selected");
|
||||
|
||||
// Type a character.
|
||||
EventUtils.synthesizeKey("a", {});
|
||||
ok(!textbox.selectedButton, "the settings item should be de-selected");
|
||||
|
||||
// Remove the character.
|
||||
EventUtils.synthesizeKey("VK_BACK_SPACE", {});
|
||||
});
|
||||
|
||||
add_task(function* test_tab() {
|
||||
is(Services.focus.focusedElement, textbox.inputField,
|
||||
"the search bar should be focused"); // from the previous test.
|
||||
|
Loading…
Reference in New Issue
Block a user