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.
- Positive
tabindexvalues such astabindex="3"that force elements to the front of the queue - CSS that reorders content visually (
orderin 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
- Tab into formFocus lands on Name
- Tab to EmailWorks as expected
- Tab againFocus jumps to Submit, skipping Phone
- Submit with gapsError or incomplete lead
- Lead lands in CRMNever reached
Example: the visual order is Name, Email, Phone, Submit, but the source order puts Submit before Phone.
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
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.
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.
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.
Note every jump
Write down any place where focus skips a field, jumps far away, goes to something hidden, or goes backwards.
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
Remove positive tabindex values
Delete any
tabindexgreater than 0. Use onlytabindex="0"(adds a custom element to the natural order) andtabindex="-1"(focusable by script only).Reorder the source
Move elements in the HTML so they appear in the order users should reach them.
Stop CSS-only reordering
If you use flexbox
order,row-reverseor grid placement to change what is shown first, change the HTML too, or remove the reordering.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.
Remove hidden items from the order
Off-screen menus and closed panels should use
display: none, thehiddenattribute orinertso Tab skips them.Retest
Tab through the page again, forward and backward.
.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 */
}<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>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.
Avoid reverse-column options
Options like 'reverse columns on mobile' can change visual order only. Test the result with Tab on mobile widths.
Search theme and plugins
Search theme files and custom HTML blocks for
tabindex="with a number above 0 and remove it.
Edit the section order
In the theme editor, reorder sections and blocks so the sequence matches the design.
Check Liquid files
In Online Store > Themes > Edit code, search for
tabindexandorder:in section files, snippets and CSS assets. Make a copy of the theme first.Test apps
Pop-ups, reviews and chat apps inject markup. Tab through the page with each enabled and disable any that break the order.
Review custom HTML tags
Look through Custom HTML tags for scripts that insert banners, widgets or pop-ups. Check where they insert elements in the page.
Insert in a logical place
Change scripts that append to the end of
bodyso that dialogs get focus management, or insert the element next to its trigger.
Use the Navigator
Open the Navigator panel. Its element order is the source order. Drag elements until it matches the visual flow.
Be careful with Flex order
The Order setting in Flex child styles changes visual order only. Reset it or reorder the elements in the Navigator.
Remove custom tab index
In Element settings, check the Tab index field and clear any value above 0.
Reorder in the builder
In the funnel or website builder, check that elements within rows and columns sit in the order you want read. Drag them if not.
Check form fields
In the form builder, reorder fields so that the list order matches the display, then test the live form with Tab.
Review custom code
Look in custom code blocks and tracking code for
tabindexvalues above 0.
Set the tab order
In the Wix Editor, use the Layers panel or the Tab Order view (Dev mode / accessibility tools) to arrange elements in the order you want users to reach them.
Check overlapping elements
Elements placed freely on the canvas can have a tab order different from their position. Re-sequence them top to bottom.
Reorder blocks and sections
Drag blocks within the section in the page editor so their order matches the layout. Squarespace builds source order from this sequence.
Check code injection
In Settings > Advanced > Code Injection, check for scripts that add widgets or set
tabindexabove 0.
Fix the markup
Reorder the HTML so that source order matches reading order. Replace layout tricks that depend on CSS
orderwith real markup changes.Manage focus in scripts
When opening dialogs, call
.focus()on the dialog or its first control and return focus to the trigger on close. Prefer the native<dialog>element withshowModal().Use inert
Add the
inertattribute to content that should not receive focus, such as the page behind an open modal or an off-screen menu.
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
- 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
tabindexabove 0
How to prevent it happening again
- 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.
Related issues
- PRF-311Focus outline removed (outline:none)Fix guide
- PRF-312Keyboard trap in modal or widgetFix guide
- PRF-313Form cannot be completed with keyboard onlyFix guide
- PRF-315Focus not moved into opened modal / not returned on closeFix guide
- PRF-316Focused element hidden behind sticky header (WCAG 2.4.11)Fix guide
- PRF-317Missing skip linkFix guide