Repository navigation
Using a High-Z-Index "Flying Focus" javascript utility to solve Focus Not Obscured (2.4.11)... Thoughts? #5194
Gcamara14
started this conversation in
Ideas (WCAG 2.x / WCAG 3)
Replies: 1 comment
|
Note that the SC isn't about the focus indicator, but the focused element, so just having the outline pierce through won't help/will still fail - see #5183 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🚀 The Question
When dealing with sticky headers or floating banners, native elements often get trapped underneath them during keyboard navigation, violating WCAG 2.4.11 (Focus Not Obscured).
While layout-level fixes like CSS scroll margins are ideal, could a global script like this serve as a reliable visual safeguard?
By rendering a custom focus ring with
z-index: 9999, it pierces through overlapping layouts to reveal exactly where the focus went—even if the underlying element is buried. This gives keyboard users an immediate cue so they can scroll to bring the component back into full view.⚡ Smart Features
z-indexlayer cuts through sticky containers, signaling the active location to the user.VISIBLE_DURATION = 500). Once the movement stops, it vanishes and seamlessly hands focus back to the browser's native outline.prefers-reduced-motionenabled at the OS level.🛠️ Code
All reactions