Bug 1577810 - Setting SearchOneOffs::selectedButton = null shouldn't remove the input's aria-activedescendant attribute when it was pointing to an item that isn't a one off search button. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D44170

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dão Gottwald 2019-08-30 17:37:25 +00:00
parent e5a9f28cf2
commit d7d5e6829f

View File

@ -306,7 +306,10 @@ class SearchOneOffs {
if (val) {
this.textbox.setAttribute("aria-activedescendant", val.id);
} else {
this.textbox.removeAttribute("aria-activedescendant");
let active = this.textbox.getAttribute("aria-activedescendant");
if (active && active.includes("-engine-one-off-item-")) {
this.textbox.removeAttribute("aria-activedescendant");
}
}
}