How to Test Focus States and Focus Order

Keyboard users need to understand two things at all times:

Where is my focus now?

and:

Where will it go next?

Focus states answer the first question.

Focus order answers the second.

When a user presses Tab, keyboard focus moves between interactive elements such as:

  • links;
  • buttons;
  • form controls;
  • menu items;
  • custom components.

The currently focused element should be visually identifiable, and the sequence should follow a logical order.

Focus problems can make a website difficult or impossible to use without a mouse.

For a broader keyboard-testing process, see How to Test Keyboard Navigation on a Website.

What Is Keyboard Focus?

Keyboard focus identifies the element that currently receives keyboard input.

For example, when focus is on a button, pressing the appropriate activation key may trigger that button.

Focus can move to elements such as:

  • links;
  • buttons;
  • text fields;
  • checkboxes;
  • radio buttons;
  • selects;
  • tabs;
  • menu controls;
  • custom interactive widgets.

The user should always be able to identify the current focus location.

What Is a Focus State?

A focus state is the visual appearance shown when an interactive element receives focus.

Examples include:

  • outline;
  • focus ring;
  • border;
  • background change;
  • underline;
  • another clearly visible indicator.

For example:

Normal Button → Focused Button With Visible Ring

The exact design can vary.

The key requirement from a QA perspective is simple:

Can the user clearly see which element currently has focus?

What Is Focus Order?

Focus order is the sequence in which focus moves through interactive elements.

For example:

Logo → Navigation → Search → Main Content → Form → Footer

Within a form:

Name → Email → Message → Submit

A poor sequence might be:

Name → Footer Link → Navigation → Submit → Email

All controls may technically be focusable, but the experience is still confusing.

Focus State and Focus Order Are Different Problems

These two issues should be tested separately.

Focus State Defect

Focus moves to the correct element, but the user cannot see where it is.

Focus Order Defect

The focus indicator is clearly visible, but the sequence is illogical.

Example:

Expected:
Name → Email → Submit

Actual:
Name → Footer Link → Email → Submit

A page can pass one area and fail the other.

Start With a Keyboard-Only Pass

For focus testing, put the mouse aside.

Use:

Tab

to move forward.

Use:

Shift + Tab

to move backward.

The purpose here is not to retest every keyboard interaction on the site.

Instead, watch:

  • where focus appears;
  • whether it remains visible;
  • where it moves next;
  • what happens after dynamic UI changes.

For complete keyboard behavior, use the broader Keyboard Navigation Testing Guide.

Start From a Fresh Page State

Reload the page and begin at the top.

Press Tab.

Ask:

What receives focus first?

Depending on the website, this might be:

  • skip link;
  • logo;
  • navigation;
  • search;
  • another interactive element.

There is no universal first control.

What matters is that the sequence is intentional and useful.

Test Skip-Link Focus

If the site provides a Skip to Content link, verify that:

  1. it becomes visible when focused where appropriate;
  2. it can be activated;
  3. focus or navigation moves to the intended content;
  4. the user does not remain stuck at the top of the page.

Skip links are particularly useful on pages with repeated navigation.

For broader accessibility coverage, see Website Accessibility Testing Checklist.

Verify That Focus Is Clearly Visible

At every focus stop, ask:

Can I immediately identify the current element?

A weak focus indicator may be:

  • too faint;
  • too thin;
  • hidden behind another element;
  • nearly identical to the normal state;
  • visible only on certain backgrounds.

A focus indicator does not need to dominate the design.

It does need to be easy to find.

Watch for Removed Browser Focus Styles

A common implementation mistake is:

outline: none;

If that removes the browser’s default indicator without a meaningful replacement, keyboard users may lose visual orientation.

Custom focus styles are fine.

Invisible focus is not.

Do Not Confuse Hover With Focus

Hover and focus are different states.

A button may have:

  • obvious mouse hover styling;
  • no visible keyboard focus styling.

Always test focus directly.

Do not assume:

The button changes when I hover over it, so keyboard accessibility is fine.

Compare Focused and Unfocused States

The focused element should be distinguishable from its normal state.

Example:

Normal: White button with blue border

Focused: White button with blue border plus a visible outer focus ring

The visual treatment can vary.

The distinction should not depend on an extremely subtle change.

Check Focus Visibility on Different Backgrounds

A focus style that works on white may disappear on:

  • dark backgrounds;
  • images;
  • colored cards;
  • gradients;
  • overlays.

Test representative backgrounds.

A pale outline on a similar-colored surface may technically exist but still be difficult to see.

Check Focus Across Representative Control Types

You do not need to test every repeated button individually.

Use representative examples of:

  • link;
  • primary button;
  • text input;
  • checkbox;
  • radio control;
  • select;
  • dropdown trigger;
  • modal button;
  • custom interactive control.

Custom components deserve particular attention because browser-native focus behavior may have been replaced.

Test Logical Focus Order

Move through the page with Tab.

Compare the keyboard sequence with:

  • visual layout;
  • reading order;
  • expected task flow.

The sequence should generally feel predictable.

For example, a form displayed as:

First Name | Last Name
Email | Phone

might reasonably follow:

First Name → Last Name → Email → Phone

If focus follows:

First Name → Email → Last Name → Phone

the visual and keyboard experience may conflict.

Watch for CSS Visual Reordering

Modern CSS can change visual order without changing DOM order.

For example, the page may visually show:

A → B → C

while the source order remains:

A → C → B

Keyboard focus may follow the source order.

This can create confusing jumps.

Pay particular attention to:

  • Flexbox ordering;
  • CSS Grid;
  • responsive rearrangement;
  • cards moved visually with CSS.

Test Forward and Backward Order

Do not test only with Tab.

Use Shift + Tab as well.

A component may work correctly forward but behave incorrectly backward.

This is especially useful for:

  • forms;
  • modals;
  • menus;
  • custom widgets.

The backward sequence should also be logical.

Make Sure Hidden Elements Are Not Focusable

If focus seems to disappear, investigate whether it moved to content that is visually hidden.

Potential examples include:

  • collapsed menu items;
  • hidden accordion content;
  • inactive tabs;
  • off-screen drawers;
  • closed modal content.

Elements hidden from users should not unexpectedly remain in the normal focus order.

Test Forms for Focus Order

Forms are one of the most important focus-order areas.

Tab through the form and verify that focus follows a logical completion path.

For example:

Name → Email → Message → Submit

Check representative:

  • text fields;
  • selects;
  • checkboxes;
  • radio groups;
  • consent controls;
  • submit button.

The focus sequence should help users complete the form rather than send them through unrelated content.

Test Multi-Column Forms Carefully

Multi-column layouts often expose DOM-order problems.

Example visual layout:

First Name | Last Name
Email | Phone

Verify that keyboard focus follows a sequence that makes sense relative to the visual presentation.

Responsive breakpoints can also change this behavior, so check the important layouts.

Check Focus After Validation Errors

Submit a form with required information missing.

Then ask:

Where does focus go?

Possible useful outcomes include:

  • first invalid field;
  • error summary;
  • another clearly understandable location.

The exact implementation can vary.

What matters is that users can find and correct the problem without losing orientation.

Check Focus After Successful Dynamic Submission

Some forms display success content without loading a new page.

Example:

Thank you. Your message has been sent.

If the page changes dynamically, verify that keyboard users can understand the new state.

Focus should not unexpectedly disappear or jump somewhere unrelated.

Test Custom Controls for Focus Visibility

Custom components frequently create focus defects.

Examples include:

  • custom checkboxes;
  • custom radio buttons;
  • custom selects;
  • autocomplete;
  • date pickers;
  • tab interfaces.

The visible custom UI should reflect focus even if the real native control is visually hidden.

Do not accept a situation where keyboard focus exists only on an invisible implementation element.

Test Focus in Dropdowns and Menus

For menu components, concentrate on focus behavior:

  • trigger receives visible focus;
  • opened content has understandable focus behavior;
  • focus does not disappear;
  • hidden page content does not unexpectedly receive focus;
  • closing the menu leaves focus somewhere sensible.

Full keyboard interaction patterns belong in the broader keyboard-navigation test.

Here, the key concern is focus location and continuity.

Test Modal Initial Focus

Modals are one of the most important focus-management scenarios.

Open a dialog.

Immediately ask:

Where is focus now?

Focus should normally move into the dialog.

Depending on the modal, the initial target might be:

  • heading;
  • first input;
  • primary action;
  • close button;
  • another meaningful control.

The appropriate target depends on context.

Focus should not remain behind the dialog.

Test Modal Focus Containment

While a true modal is open:

  1. press Tab through its controls;
  2. continue past the last control;
  3. repeat using Shift + Tab backward.

Focus should normally remain within the modal.

It should not move into background content that the user cannot currently interact with visually.

Test Focus Return After Closing a Modal

Close the modal.

Then ask:

Where did focus go?

In many cases, focus should return to the element that opened the dialog.

Example:

View Details → Modal → Close → View Details

This gives the user a predictable continuation point.

If focus instead jumps to the top of the page, the user may need to navigate through the entire page again.

Test Nested Dialogs Carefully

Some applications open one dialog from another.

Example:

Modal A → Modal B → Close B → Modal A

Verify that focus:

  • moves into Modal B;
  • stays there appropriately;
  • returns to the correct location in Modal A;
  • does not jump to the page background.

Nested overlays are a common source of broken focus management.

Test Focus After Dynamic Content Changes

Modern applications often update content without full page navigation.

Examples include:

  • filtering;
  • search;
  • saving;
  • deletion;
  • loading more results;
  • pagination;
  • inline editing.

After the update, ask:

Where is focus now?

The user should not lose their position unexpectedly.

Test Focus After Filtering

Suppose the user changes a filter and the results list refreshes.

Verify that focus:

  • does not disappear;
  • does not jump unpredictably;
  • remains in a useful location.

This is especially important if the filter causes the focused element itself to disappear.

Test Focus After Deleting an Item

Example:

Record → Delete → Confirmation → Record Removed

After deletion, focus should move somewhere meaningful.

Possible targets may include:

  • next item;
  • previous item;
  • list heading;
  • another logical control.

Avoid leaving focus attached to an element that no longer exists.

Test Focus After Saving

In web applications, saving can trigger a rerender.

Example:

Edit → Save → Success State

Verify that the user’s focus is preserved or moved intentionally.

Focus should not silently reset to the beginning of the page unless that behavior is clearly justified.

Test Focus After Pagination

If the user activates:

Next Page

or a specific page number, verify that the updated state does not leave focus in an unexpected location.

The appropriate behavior depends on implementation, but the user should understand where they are after the page change.

Test Responsive Focus Order

Responsive layouts can change:

  • visual order;
  • navigation structure;
  • element visibility;
  • component layout.

A page may have correct focus order on desktop and confusing order on mobile.

Check representative breakpoints where the structure changes meaningfully.

For the wider responsive process, see Responsive Website Testing Checklist.

Test Mobile Navigation Focus Management

Mobile menus often use overlays or drawers.

When the menu opens, verify:

  • focus moves into the menu where appropriate;
  • hidden page content does not remain in the active focus path;
  • the close control is reachable;
  • closing the menu returns focus sensibly.

You do not need to repeat every navigation interaction from the keyboard-navigation guide.

Focus on where focus goes during the state transition.

Test Focus at Zoomed or Narrow Layouts

Focus indicators can become obscured when:

  • content reflows;
  • sticky headers overlap controls;
  • fixed footers cover lower elements;
  • zoom changes element positions.

Check that focused elements remain visible.

A visible focus ring is not useful if the focused element itself is hidden behind a fixed UI layer.

Test Sticky and Fixed Elements

Sticky headers, bottom bars, and floating buttons can obscure focus.

Tab through controls near:

  • top edge;
  • bottom edge;
  • fixed navigation;
  • sticky form buttons.

Make sure the focused element can actually be seen.

Test Focus in Authentication Flows

Login and password-reset screens usually contain few controls, making focus problems easy to identify.

For example:

Email → Password → Log In

Verify that the sequence is logical and that validation does not cause unpredictable focus jumps.

For the broader functional workflow, see How to Test Login, Signup and Password Reset Flows.

Test Focus in Critical Conversion Flows

For important user journeys, confirm that focus remains usable through the critical path.

Examples include:

  • signup;
  • contact form;
  • checkout;
  • subscription;
  • payment;
  • core SaaS workflow.

You do not need to reproduce the entire functional QA plan here.

Focus specifically on:

  • visible focus;
  • logical order;
  • focus management after UI changes.

For broader journey planning, see How to Identify Critical User Journeys for Website Testing.

Test Focus in Complex SaaS Interfaces

Business applications often contain:

  • tables;
  • bulk actions;
  • dropdowns;
  • inline editing;
  • modals;
  • record forms.

Focus testing should verify that users do not lose their position when moving through these interfaces.

For example:

Edit Record → Open Modal → Save → Close Modal → Return to Trigger

is a focus-management workflow.

For the functional side of these interfaces, see How to Test CRUD Workflows in Web Applications.

Do Not Force Custom Tab Order Without Good Reason

Positive tabindex values can create fragile and unpredictable focus sequences.

For example:

tabindex="1"
tabindex="2"
tabindex="3"

may appear to solve one page layout while creating maintenance problems elsewhere.

From a QA perspective, focus on the resulting behavior.

Report:

  • expected sequence;
  • actual sequence;
  • affected controls.

Do not prescribe implementation unless you know the component architecture.

Document Focus Defects Precisely

Avoid vague reports such as:

Tab order is wrong.

A stronger report identifies the exact sequence.

Example:

Title: Focus jumps from Email field to footer before Password

Environment:
Chrome / Windows

Steps:

  1. Open Login.
  2. Press Tab until Email receives focus.
  3. Press Tab again.

Expected:
Email → Password

Actual:
Email → Footer Privacy Link → Password

This gives development a concrete sequence to investigate.

Include the Exact Keyboard Action

Useful reproduction details may include:

  • Tab;
  • Shift + Tab;
  • Enter;
  • Space;
  • Escape.

Instead of only writing:

Press Tab six times.

prefer documenting the elements as well.

Example:

Expected:
Search → Account → Cart

Actual:
Search → Hidden Menu Item → Account → Cart

Include Viewport When Relevant

If the focus defect appears only at a certain responsive layout, document the viewport.

Example:

Viewport: 390 × 844

This can dramatically reduce reproduction time.

Include Browser When Relevant

If behavior differs between browsers, document the environment.

Example:

Safari / macOS

and optionally:

Chrome / macOS — passes

Browser comparisons can help isolate implementation differences.

For broader coverage, see How to Test a Website on Safari, Chrome, Firefox and Edge.

Use Video for Focus-Order Problems

Screenshots are useful for:

  • missing focus indicator;
  • weak focus contrast;
  • obscured focus.

Video is often better for:

  • unexpected tab order;
  • focus jumps;
  • modal focus leakage;
  • focus disappearing after dynamic updates.

Keep recordings short and centered on the reproduction sequence.

Severity Depends on User Impact

Not all focus defects are equally serious.

Lower Impact

Focus style differs slightly but remains obvious.

Medium Impact

Order is confusing, but users can still complete the task.

High Impact

An important control cannot be reached or focus becomes effectively invisible.

Potential Release Blocker

A keyboard user cannot complete a critical workflow such as:

  • login;
  • checkout;
  • primary form;
  • core SaaS action.

For the broader severity framework, see Bug Severity vs Priority.

Retest the Exact Focus Sequence

After a fix, repeat the original interaction exactly.

For example:

Tab → Open Modal → Tab Through Modal → Close → Verify Focus Return

Then perform targeted regression around the same component.

Focus-management code is often shared.

A modal fix on one screen may affect dialogs elsewhere.

Add Important Focus Scenarios to Regression

High-value scenarios should become repeatable checks.

Examples:

  • primary navigation focus;
  • login focus order;
  • form validation focus;
  • primary modal focus trap;
  • modal focus return;
  • checkout focus sequence.

This makes accessibility QA more consistent across releases.

A Practical Focus Testing Workflow

Step 1 — Start Without the Mouse

Use keyboard navigation from a clean page state.

Step 2 — Verify Visible Focus

Check representative interactive elements.

Step 3 — Follow the Focus Order

Compare keyboard sequence with visual and logical order.

Step 4 — Test Backward Navigation

Use Shift + Tab.

Step 5 — Test Forms

Check field order, validation, and post-submission focus.

Step 6 — Test Modals and Overlays

Verify initial focus, containment, and return.

Step 7 — Test Dynamic Updates

Check filtering, saving, deleting, and pagination.

Step 8 — Test Responsive States

Review layouts where the structure changes.

Step 9 — Document the Exact Sequence

Record current focus, next focus, viewport, and browser where relevant.

Step 10 — Retest and Regress

Repeat the original sequence and representative shared-component scenarios.

Focus States and Focus Order Checklist

Focus Visibility

  • Important interactive elements show visible focus.
  • Focus differs clearly from the normal state.
  • Focus remains visible on light backgrounds.
  • Focus remains visible on dark or colored backgrounds.
  • Fixed UI does not obscure focused elements.
  • Sticky UI does not obscure focused elements.

Focus Order

  • Tab order is logical.
  • Focus order generally aligns with the visual structure.
  • Shift + Tab is logical.
  • Interactive elements are not unexpectedly skipped.
  • Hidden controls are not unexpectedly focusable.
  • Non-interactive content does not create unnecessary focus stops.

Forms

  • Fields follow a logical sequence.
  • Required-field errors are discoverable.
  • Custom controls show focus.
  • Submit button is reachable.
  • Focus remains understandable after validation.
  • Dynamic success states do not cause focus to disappear.

Modals and Overlays

  • Initial focus moves into the modal appropriately.
  • Focus remains inside a true modal.
  • Backward focus remains inside the modal.
  • Close control is reachable.
  • Focus returns to a sensible location after closing.
  • Nested dialogs restore focus correctly.

Dynamic Content

  • Filtering does not create unexplained focus loss.
  • Save operations preserve or intentionally move focus.
  • Delete operations move focus somewhere meaningful.
  • Pagination leaves the user oriented.
  • Notifications do not steal focus unnecessarily.

Responsive Layouts

  • Desktop focus order is logical.
  • Mobile focus order is logical.
  • Responsive reordering does not create confusing focus jumps.
  • Focus remains visible at narrow widths.
  • Zoomed layouts do not hide the focused element.

Common Mistake: Checking Only Whether Tab Works

A page may allow Tab navigation and still be difficult to use.

You also need to ask:

Where does focus go?

and:

Can the user see it?

The existence of focusable controls is not enough.

Common Mistake: Using Hover as Focus

Hover helps mouse users.

Focus helps keyboard users.

A visible hover effect does not replace a visible focus state.

Common Mistake: Testing Only Forward

Shift + Tab can expose defects that forward Tab does not.

Always test both directions on important components.

Common Mistake: Ignoring Focus Return

A modal may work correctly while open, but closing it sends focus to the top of the page.

That can force keyboard users to navigate through the page again.

Focus return is part of the workflow.

Common Mistake: Ignoring Hidden Focusable Elements

If focus seems to disappear, it may have moved to an invisible control.

Inspect:

  • collapsed content;
  • hidden menus;
  • off-screen components;
  • inactive tabs.

Invisible focus stops are common in dynamic interfaces.

Common Mistake: Removing the Default Focus Indicator

Browser focus styling may not perfectly match the visual design.

Removing it without a proper replacement creates a much larger usability problem.

Accessible custom focus styling is better than invisible styling.

Common Mistake: Treating Focus Testing as the Entire Keyboard Test

Focus testing is a specialized part of keyboard accessibility.

It does not replace testing:

  • activation behavior;
  • widget keyboard patterns;
  • arrow-key interaction;
  • keyboard shortcuts;
  • full keyboard operability.

Those belong in the broader Keyboard Navigation Testing Guide.

Combine Focus Testing With Wider Accessibility QA

Focus is one accessibility area.

A complete accessibility review may also include:

  • headings;
  • labels;
  • alt text;
  • contrast;
  • zoom;
  • reflow;
  • keyboard operability;
  • form semantics.

For the wider process, see Website Accessibility Testing Checklist.

Build Focus Testing Into Regular QA

Do not leave focus testing until the final accessibility review.

Include representative checks when testing:

  • navigation changes;
  • new forms;
  • new modals;
  • custom controls;
  • responsive redesigns;
  • dynamic application features.

A practical flow is:

Page Loads → Tab From Top → Verify Visible Focus → Check Order → Test Forms → Test Modal Focus → Test Dynamic Changes → Test Responsive Layout → Report → Retest

For teams that need structured accessibility, browser, responsive, regression, and release workflows, Qualavo QA Professional provides a broader QA framework.

Final Thoughts

Focus states and focus order are fundamental to keyboard accessibility.

A keyboard user should always be able to answer:

Where is my focus now?

and:

Where will it go next?

Test both.

Make sure important interactive elements have visible focus.

Then verify that focus moves through the interface in a logical sequence.

Pay particular attention to:

  • forms;
  • responsive layouts;
  • modals;
  • dynamic content;
  • custom controls;
  • critical workflows.

Do not stop at:

Tab works.

Instead ask:

Can the user see their current position, predict the next focus location, and keep their place when the interface changes?

That is the real objective of effective focus-state and focus-order testing.

Similar Posts