Menu

Keyboard focus: the five checks that catch most accessibility bugs in a form
📰

Keyboard focus: the five checks that catch most accessibility bugs in a form

DEV Community: frontend·Mogley1011·17 days ago
#pYKTz86Y
#devtofrontend#devto#dev#focus#order
Reading 0:00
15s threshold

Most keyboard problems in forms are visible in two minutes with nothing but the Tab key. Unplug the mouse and walk through the page.

What to check

Can you see where you are? Every interactive element needs a visible focus indicator. outline: none without a replacement fails WCAG 2.4.7 (Focus Visible). Prefer :focus-visible so mouse clicks stay quiet while keyboard users get a clear ring.

Does the order match the reading order? Tab follows DOM order. If CSS reorders things visually (flex order , grid placement, absolute positioning), keyboard order and visual order drift apart (WCAG 2.4.3).

Can you get out? A modal must move focus in on open, keep it inside, close on Escape, and return focus to the button that opened it. A focus trap with no exit is a hard blocker.

Is every control reachable and named? A div with a click handler is not focusable and has no role. Use button and a , and give icon-only buttons an accessible name ( aria-label or visible text).

Do errors reach the user?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.