Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
6db4b54e
Commit
6db4b54e
authored
Nov 15, 2022
by
henry
Committed by
Richard Pospesel
Feb 8, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Bug 41454: Move focus after calling openPreferences for a sub-category.
Temporary fix until mozilla bug 1799153 gets a patch upstream.
parent
8747fce6
Branches
Branches containing commit
No related tags found
1 merge request
!545
Rebase tor-browser to esr102.8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
browser/components/preferences/preferences.js
+11
-0
11 additions, 0 deletions
browser/components/preferences/preferences.js
with
11 additions
and
0 deletions
browser/components/preferences/preferences.js
+
11
−
0
View file @
6db4b54e
...
...
@@ -460,6 +460,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
"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment