Skip to main content
SiteScan.top

Keyboard focus on mobile: menus, dialogs and fields you can actually reach

A hamburger menu that opens only on tap, a field with no focus ring, a dialog that traps nobody: how to test keyboard focus on a phone layout and fix what breaks.

Accessibility · Published: 2 November 2026 · 5 min read · Марк Лебедев

Most accessibility reviews happen on a desktop screen, and most keyboard bugs live in the phone layout. The hamburger menu, the compact language switcher and the full-screen dialog exist only below a breakpoint, so a developer testing at 1440 px never tabs through them. Yet people do use a keyboard on a narrow screen: a Bluetooth keyboard with a tablet, switch access, a screen reader's swipe navigation that follows the same focus order, or simply a desktop browser zoomed to 400%, which WCAG expects a site to survive.

What "works with a keyboard" means, element by element

The menu button. It must be reachable with Tab, carry a name ("Menu", not an empty icon), open with Enter or Space, and report its state through aria-expanded — false when closed, true when open. After it opens, the next Tab has to land inside the menu, not on the page hidden behind it. Escape should close it, and focus should return to the button rather than jumping to the top of the document.

The language selector. A bare "EN" or "RU" is a poor accessible name: a screen reader spells out two letters and the user still does not know what the control does. Give it a name like "Language: English". On a phone it also has to be big enough to hit — WCAG 2.2 sets 24 × 24 CSS pixels as the minimum target size (criterion 2.5.8) — and it should not sit flush against the menu button, or a thumb opens the wrong one.

Form fields. Every field needs a name a screen reader can announce — a <label>, aria-label or aria-labelledby; placeholder text alone disappears as soon as someone types. And when the field receives focus, something visible must change.

Dialogs. A cookie banner or sign-up modal that opens from a button has to move focus into itself, keep Tab inside while it is open, close on Escape and give focus back to whatever opened it. A dialog that leaves focus on the page underneath is invisible to a keyboard user — they keep tabbing through links they cannot see.

The focus ring nobody meant to remove

The most common failure is a single CSS rule: outline: none added to buttons or inputs because the default ring looked out of place in a mouse-driven design review. WCAG 2.4.7 (Focus Visible) requires a visible indicator, and 2.4.11 in WCAG 2.2 adds that the focused element must not be completely hidden behind a sticky header or a banner.

The fix does not bring back the look designers disliked. Use :focus-visible, which browsers apply when focus came from the keyboard and usually skip for mouse clicks:

``css button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; } ``

Check the ring against both the element and its background — a blue outline on a blue button is technically present and practically invisible. Custom selects built from <div>s need extra care: the visible element is often not the one that receives focus.

How to test it in ten minutes

  1. Open the site in a desktop browser, switch the device toolbar to a phone size such as 390 × 844, and reload.
  2. Click the address bar, then press Tab repeatedly. Watch where focus goes; if you lose track of it, that is the first finding.
  3. Open the menu with Enter, tab through it, press Escape. Is focus back on the button?
  4. Tab into every form field. Is there always a visible change?
  5. Trigger any dialog from the keyboard and repeat the Escape test.

The accessibility guide covers what automated rules catch and what still needs a person; mobile usability covers the layout side.

What SiteScan checks

A browser scan opens your home page at phone size and goes through it with a keyboard. The "Mobile accessibility" section of the report shows, for the hamburger menu, the language selector, the form fields and any dialog, whether each one is reachable with Tab, has a name, shows focus, opens from the keyboard, takes focus in, closes on Escape and hands focus back — plus the axe-core rules that failed on the page. Each row names the element by its selector, so the developer knows exactly which control to fix. Start a free scan to see yours.

Read next

Check how much of this is on your own site

A free scan surfaces broken links, JS errors and performance problems in about a minute.