Skip to content

Fix extra tab press from veggie burger to sub nav on mobile - #17354

Draft
jay23606 wants to merge 1 commit into
guardian:mainfrom
jay23606:pr-go-simple/14031
Draft

jay23606 wants to merge 1 commit into
guardian:mainfrom
jay23606:pr-go-simple/14031

Conversation

@jay23606

Copy link
Copy Markdown

The mobile expanded menu is collapsed with translateX(-110%), which moves it off-screen but leaves it focusable, so the first Tab from the veggie burger landed on a hidden menu link and a second Tab was needed to reach the sub nav.

Change: ExpandedNav.tsx sets visibility: hidden on the collapsed mobile menu (with a visibility transition so the close animation still plays) and visibility: visible when it is open. Desktop is unchanged because the menu is display: block there.

Test: the existing Playwright test 'should transfer focus to the sub nav when tabbing from the veggie burger without opening the menu' previously pressed Tab twice with a TODO describing this bug. It now presses Tab once and the TODO is removed.

Not run here: dependencies were not installed and CI was asked to run the tests, so the Playwright and Jest suites were not executed locally. Visual check of the open/close animation in a browser was also not done.

Tests not run here: pnpm playwright test playwright/tests/article.interactivity.e2e.spec.ts (dependencies not installed; CI to run), pnpm jest / lint / typecheck (dependencies not installed; CI to run)

Fixes #14031

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tabbing from burger menu to sub nav requires two tab presses

1 participant