fix(anchor-menu): keep sticky menu keyboard-reachable at 200% zoom - #1713
Conversation
The sticky behavior relocated the menu in the DOM (globalHeader.appendChild), which moved its focusable controls out of the keyboard tab order. At 200% desktop zoom (effective width < lg) the menu is a collapsed sticky bar, so forward Tab skipped it entirely and keyboard users could not reach it. Pin the menu in place with CSS (position: fixed; top: var(--uds-anchor-menu-top)) instead of moving the node, mirroring the unity-react-core AnchorMenu. The node never leaves its document position, so tab order is preserved. Attach/detach is now driven by a scroll threshold against the stored original offset rather than the live rect of a now-fixed element. Fixes WCAG 2.1.1 Keyboard (Level A) and 2.4.3 Focus Order (Level A). UDS-1638 / UDS-2160
|
Storybook deployed at https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1713/index.html |
mlsamuelson
left a comment
There was a problem hiding this comment.
AI generated descriptions can be a bit wordy and add more time to read to review. Perhaps they can be made more brief?
Ran into an issue testing this - both the current live Bootstrap version of the anchor menu and the one displayed here don't provide the chevron for the dropdown, so I'm unable to verify: https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1713/@asu/unity-react-core/index.html?path=/story/components-anchormenu--default
@mlsamuelson you're right about description I just adjusted it. Note on the earlier test: the story linked in the review is the unity-react-core AnchorMenu, this PR only changes the unity-bootstrap-theme version, so that story wouldn't show the fix. The right one is below. Story: anchor-menu QA steps (I just ran these against the staging build )
|
Description
At 200% desktop zoom, the anchor menu became unreachable by keyboard — tabbing skipped it entirely (accessibility audit, UDS-1638 / UDS-2160).
Root cause: the sticky behavior moved the menu node into the global header (
appendChild). Tab order follows DOM order, so the menu's controls jumped to a point earlier in the document than the user's current focus, and forward Tab never landed on them.Fix: pin the menu with CSS (
position: fixed; top: var(--uds-anchor-menu-top)) instead of relocating the node, with attach/detach driven by a scroll threshold. This matches how the unity-react-coreAnchorMenualready positions itself. Fixes WCAG 2.1.1 (Keyboard) and 2.4.3 (Focus Order).Testing Steps
Checklist
Links