Skip to content

fix(foundation): keep phone menu focus rings inside the menu - #1691

Merged
gregpriday merged 2 commits into
developfrom
bugfix/issue-1379-phone-navigation-clips-the-right-edge-of
Nov 28, 2026
Merged

gregpriday merged 2 commits into
developfrom
bugfix/issue-1379-phone-navigation-clips-the-right-edge-of

Conversation

@gregpriday

Copy link
Copy Markdown
Member

Resolves #1379

With no action button, the header's list of links is the nav's last child, so .so-header__list:where(:last-child) pulls its end out by --so-header-link-x to line the open row's last word up with the page edge. The phone and compact column menus reset only margin-inline-start. The list (and every full-width link in it) therefore stuck out past the menu's end: 4 px at 320 px and 2 px at 390 px. The menu is a scroll container (overflow-y: auto), so it scrolled sideways and clipped the focus outline's right side. At 820 px the compact menu's wider gutter hid the overflow, but the same −8 px margin was there.

Changes

  • Both column-menu .so-header__list rules (phone and .so-header--compact) reset margin-inline: 0.
  • The column menu's side padding never drops below 5 px (max(5px, gutter − space.sm)), the room the theme's focus ring (2 px outline + 3 px offset) needs. Default gutters already give 8.5 px or more, so default rendering is unchanged; only a gutter token under 17 px moves the rows' words inward.
  • The same edit in both committed releases (resources/packs/foundation, resources/packs-dev/foundation-alt), with the digests in resources/packs.lock.json refreshed. npm run build:packs -- --committed reports they match.

Follow-up: the header is authored in siteorigin/builder-components, so the same two CSS changes need to land there too. Otherwise the next npm run build:packs refresh from that checkout would undo this fix.

Testing

  • New tests/unit/header-menu-focus-ring-browser.test.ts (Chromium, both themes). It mounts the showcase header with no action, opens the menu with Enter and Tabs through every visible control. It checks that the menu doesn't scroll sideways, that the list's end margin is 0, and that each control's rect, expanded by its computed outline width and offset, sits inside the menu's padding box and the viewport. Cases: 320 × 720, 390 × 844, compact at 820 × 1180, and 320 and compact 820 with a 16 px gutter. All cases failed on develop (324 > 320, 392 > 390, -8px ≠ 0px). They all pass now, and putting back only the compact padding floor fails the compact 16 px case.
  • Adjacent and impact: 23 of 664 unit test files, chosen by hand for the header and the pack releases (the selector doesn't trace JSON packs): committed-packs, pack-loader, packs-gate, theme-packs, foundation-html, header-focus-browser, header-menu, header-menu-order, foundation-interactive(-browser) and others. All green.
  • npm run typecheck:changed green; prettier clean on the changed test.

…an action

- the column menus reset both inline margins of the links list, so the last-child
  pull meant for the open row no longer overflows the menu sideways
- the menu's side padding never drops below the 5 px a focus ring needs
- refresh the Foundation pack digests
…nu control

- a 16 px gutter in the compact menu, so the compact floor can't regress alone
- Tab has to reach each control the open menu shows
@gregpriday
gregpriday force-pushed the bugfix/issue-1379-phone-navigation-clips-the-right-edge-of branch from 25dedda to 9b048d3 Compare November 28, 2026 10:22
@gregpriday
gregpriday merged commit 7d9a010 into develop Nov 28, 2026
1 check failed
@gregpriday
gregpriday deleted the bugfix/issue-1379-phone-navigation-clips-the-right-edge-of branch November 28, 2026 10:23
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.

Phone navigation clips the right edge of keyboard focus

1 participant