Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Illogical focus order: how to find and fix tab order problems

PRF-314Medium impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

Focus order is the sequence in which interactive elements (links, buttons, form fields) receive focus as you press the Tab key. Browsers follow the order of the HTML source by default, not what the page looks like. If the two differ, focus appears to jump: from the header to the footer, from a form's first field to its submit button, or behind a pop-up.

Typical causes of a bad focus order
  • Positive tabindex values such as tabindex="3" that force elements to the front of the queue
  • CSS that reorders content visually (order in flexbox, grid-area, flex-direction: row-reverse, absolute positioning) without changing the HTML
  • Pop-ups, chat widgets or cookie banners added at the end of the page source but shown on top
  • Page builders where sections were dragged into a new position but the markup stayed in a different order
  • Hidden menus or off-screen panels that still accept focus
  • Content injected by JavaScript into the wrong place in the page

Why it costs you leads or sales

How a bad focus order loses a lead
  1. Tab into formFocus lands on Name
  2. Tab to EmailWorks as expected
  3. Tab againFocus jumps to Submit, skipping Phone
  4. Submit with gapsError or incomplete lead
  5. Lead lands in CRMNever reached

Example: the visual order is Name, Email, Phone, Submit, but the source order puts Submit before Phone.

Form completion by keyboard usersExample numbers
Form completion by keyboard users (example)Logical focus order: 70 %; Illogical focus order: 35 %027547035Logical focus orderIllogical focus order%

Example: illustrative numbers showing how a confusing tab order could reduce completion for keyboard users. Not real measurements.

How to check if your site has it

Test your focus order by hand
  1. Put the mouse away

    Load the page and click once in an empty area or the address bar. Press Tab to move forward and Shift+Tab to go back.

  2. Watch the focus ring

    At every press, note where the visible focus indicator goes. It should move in the same order you would read the page: left to right, top to bottom, in the same sequence as the layout.

  3. Walk a full journey

    Tab through a whole form or checkout, open any menu, modal or chat widget, and close it again. Focus should move into an opened pop-up first and return to where you were afterwards.

  4. Note every jump

    Write down any place where focus skips a field, jumps far away, goes to something hidden, or goes backwards.

  5. Inspect the source

    In browser DevTools, open the Elements panel and search for tabindex=" to find positive values. In Chrome, the Accessibility tab and the Issues panel can also help you inspect the DOM order.

How to fix it

Fix focus order
  1. Remove positive tabindex values

    Delete any tabindex greater than 0. Use only tabindex="0" (adds a custom element to the natural order) and tabindex="-1" (focusable by script only).

  2. Reorder the source

    Move elements in the HTML so they appear in the order users should reach them.

  3. Stop CSS-only reordering

    If you use flexbox order, row-reverse or grid placement to change what is shown first, change the HTML too, or remove the reordering.

  4. Place pop-ups correctly

    For modals, move focus into the dialog when it opens and return it to the trigger on close. Make the content behind it inert.

  5. Remove hidden items from the order

    Off-screen menus and closed panels should use display: none, the hidden attribute or inert so Tab skips them.

  6. Retest

    Tab through the page again, forward and backward.

Risky: visual order differs from source ordercss
.form-row {
  display: flex;
  flex-direction: row-reverse; /* Tab order now runs opposite to what users see */
}

.submit {
  order: -1; /* Looks last? Tab still reaches it first or in source position */
}
Safe: natural source order, no positive tabindexhtml
<form>
  <label for="name">Name</label>
  <input id="name" name="name" type="text">

  <label for="email">Email</label>
  <input id="email" name="email" type="email">

  <label for="phone">Phone</label>
  <input id="phone" name="phone" type="tel">

  <button type="submit">Send</button>
</form>
Where to change it on your platform
  1. Check the builder layout

    In Elementor, Divi, Gutenberg or similar, check the Navigator or List View. The order listed there is usually the source order. Drag elements so it matches the visual layout.

  2. Avoid reverse-column options

    Options like 'reverse columns on mobile' can change visual order only. Test the result with Tab on mobile widths.

  3. Search theme and plugins

    Search theme files and custom HTML blocks for tabindex=" with a number above 0 and remove it.

Focus order before and after

Before

  • Source order differs from the layout
  • Positive tabindex values scattered across the page
  • Tab jumps from Email to the footer, then to Phone
  • Modal opens but focus stays on the page behind

After

  • Source order matches the visual layout
  • Only tabindex 0 and -1 are used
  • Tab moves Name, Email, Phone, Submit
  • Focus moves into the modal and returns on close

How to confirm it's fixed

Confirmation checklist
  • Tab through each key page from top to bottom: the focus ring follows the reading order
  • Shift+Tab goes back through the same sequence in reverse
  • No element is skipped and no hidden element receives focus
  • Forms can be completed from first field to submit in a natural order
  • Opening a modal moves focus into it; closing returns focus to the trigger
  • Test at desktop and mobile widths, since responsive layouts often change the order
  • A search of the page source finds no tabindex above 0

How to prevent it happening again

Prevention habits
  • Add a 2-minute Tab-through to your release or page-publish checklist
  • Ban positive tabindex in code review and theme guidelines
  • Reorder markup, not just CSS, when changing layouts
  • Re-test after installing or updating pop-up, chat, consent or form plugins
  • Run an accessibility scanner such as axe DevTools or Lighthouse as a first filter, then do the manual Tab test, because automated tools only catch part of focus order problems

How FunnelGuard handles this

Questions people ask

What is focus order in web accessibility?

Focus order is the sequence in which links, buttons and form fields receive keyboard focus when you press Tab. WCAG 2.4.3 requires this sequence to preserve the meaning and operability of the page. In practice it should follow the visual reading order.

Why does my Tab key jump around the page?

Browsers follow the order of the HTML source, so a jump usually means the source order differs from the layout. Common causes are positive tabindex values, CSS reordering such as flexbox order, and pop-ups or widgets added elsewhere in the markup.

How do I test tab order on my website?

Use only the keyboard: press Tab to go forward and Shift+Tab to go back, and watch the focus ring. It should move through the page in reading order without skipping or jumping. Accessibility Insights for Web can also draw the tab stops on the page.

Should I use tabindex to fix focus order?

Avoid positive tabindex values. Fix the order by rearranging the HTML so it matches the layout. Use tabindex="0" only to make a custom element focusable and tabindex="-1" for elements focused by script.

Does CSS order change the tab order?

No. CSS properties such as flexbox order, grid placement and row-reverse change how things look, but keyboard focus still follows the HTML source. If you reorder visually, reorder the markup too.

Is illogical focus order a WCAG failure?

Yes. It fails success criterion 2.4.3 Focus Order, a Level A requirement in WCAG 2.2. It can also affect 1.3.2 Meaningful Sequence when the source order changes the meaning of the content.

Can an automated tool detect bad focus order?

Only partly. Scanners can find positive tabindex values and some structural issues, but judging whether the order makes sense needs a person tabbing through the page. Combine an automated scan with a manual keyboard test.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.