BBMM Technologies
← All articles
7 min readaccessibility, keyboard, focus, wcag

Keyboard Accessibility and Focus Management

By Mykhailo Boichuk · Co-founder & Vice-President

In short

Keyboard accessibility means every interactive element can be reached and operated without a pointer, which many users rely on entirely. It requires a visible focus indicator, a focus order that matches the logical flow, and deliberate focus management when dialogs and menus open and close. The frequent failures are removed focus outlines, focus traps with no escape, and custom controls that the keyboard cannot reach at all.

The keyboard is the baseline

Many people operate software entirely from the keyboard, whether because they use a screen reader, cannot use a pointer, or simply work faster that way. For them, an element that can only be activated by a mouse does not exist. Keyboard operability is therefore not an enhancement layered on top of a pointer interface; it is the baseline that everything else extends.

The implication is that every interactive element must be reachable by keyboard and operable with the expected keys. A custom control that looks like a button but cannot be focused or activated from the keyboard is broken for a substantial group of users, no matter how it behaves under a mouse.

Visible focus and logical order

A keyboard user must always be able to see where focus is, which is why removing the focus outline, a common cosmetic decision, is so damaging. If you replace the default indicator, replace it with something at least as visible, never with nothing. Equally, the order in which focus moves should follow the logical reading and interaction order, because a focus order that jumps around the screen is disorienting and hard to follow.

  • Keep a clearly visible focus indicator; never remove it without a stronger replacement.
  • Ensure focus order follows the logical flow of the content.
  • Make every interactive element reachable and operable with the keyboard.

Manage focus around dialogs and menus

Components that appear and disappear demand active focus management. When a dialog opens, focus should move into it, stay within it while it is open, and return to the triggering element when it closes. A dialog that opens without moving focus leaves keyboard users stranded behind it, and one that traps focus with no way to close is worse still. Menus and other transient surfaces need the same care.

A focus trap is acceptable and even necessary inside a modal dialog, but only if there is always a keyboard way out. A trap with no escape is one of the most frustrating accessibility failures.

Test by unplugging the mouse

The most direct test of keyboard accessibility is to put the pointer aside and try to complete every task with the keyboard alone. Problems that are invisible to a mouse user surface immediately: an element that cannot be reached, a focus indicator that vanished, a dialog that strands focus. Pairing this with a screen reader reveals a further layer, since visible focus and announced focus are not always the same.

Key takeaways

  • Many users operate entirely by keyboard, so keyboard operability is the baseline.
  • Every interactive element must be reachable and operable without a pointer.
  • Keep a visible focus indicator and a focus order that follows the logical flow.
  • Move focus into dialogs, keep it there while open, and return it on close.
  • Test by setting the mouse aside and completing every task with the keyboard.

Frequently asked questions

Why is removing the focus outline a problem?
Keyboard users rely on the visible focus indicator to know where they are. Removing it without an equally visible replacement makes the interface unusable for them.
How should a dialog handle keyboard focus?
Move focus into the dialog when it opens, keep focus within it while open, and return focus to the triggering element when it closes, always with a keyboard way to exit.
What is the simplest keyboard accessibility test?
Set the mouse aside and try to complete every task with the keyboard alone, ideally also with a screen reader running.

References

About the author

Mykhailo Boichuk

Co-founder & Vice-President

Mykhailo is an engineer who builds native applications and the systems behind them. He concentrates on macOS and iOS performance, local-first data architecture, and the synchronization problems that come with offline-capable software.