Skip to content
Snippets Groups Projects
Verified Commit 48fa2184 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

Bug 41454: Move focus after calling openPreferences for a sub-category.

Temporary fix until mozilla bug 1799153 gets a patch upstream.
parent 863467c1
No related branches found
No related tags found
1 merge request!641Bug 41759: Rebase Base Browser to 115 Nightly
......@@ -487,6 +487,17 @@ async function scrollAndHighlight(subcategory, category) {
}
let header = getClosestDisplayedHeader(element);
// We assign a tabindex=-1 to the element so that we can focus it. This allows
// us to move screen reader's focus to an arbitrary position on the page.
// See tor-browser#41454 and bug 1799153.
element.setAttribute("tabindex", "-1");
// The element is not always immediately focusable, so we wait until the next
// loop.
setTimeout(() => {
Services.focus.setFocus(element, Services.focus.FLAG_NOSCROLL);
element.removeAttribute("tabindex");
});
scrollContentTo(header);
element.classList.add("spotlight");
}
......
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