Fix aria-required-children in Shopify Liquid
Shopify themes often trigger aria-required-children inside snippets/header-mega-menu.liquid, custom product tab sections, and predictive search dropdowns (role='listbox' containing <a> cards instead of role='option' items). Matching required ARIA child roles—or switching mega-menus to standard semantic <ul><li><a>—fixes the storewide error cleanly.
Before and after
{%- comment -%} sections/product-tabs.liquid (Broken: tablist with unattributed <li> & <button>) {%- endcomment -%}
<div class="product-tabs" role="tablist" aria-label="{{ product.title | escape }} information">
<ul class="tabs-nav">
<li><button type="button" data-tab="desc">Description</button></li>
<li><button type="button" data-tab="care">Care & Sizing</button></li>
</ul>
</div>{%- comment -%} sections/product-tabs.liquid (Fixed: role="none" on <li> and role="tab" on buttons) {%- endcomment -%}
<ul class="tabs-nav" role="tablist" aria-label="{{ product.title | escape }} information">
<li role="none">
<button
type="button"
role="tab"
id="TabDesc-{{ section.id }}"
aria-selected="true"
aria-controls="PanelDesc-{{ section.id }}"
>
Description
</button>
</li>
<li role="none">
<button
type="button"
role="tab"
id="TabCare-{{ section.id }}"
aria-selected="false"
aria-controls="PanelCare-{{ section.id }}"
tabindex="-1"
>
Care & Sizing
</button>
</li>
</ul>Fixed vs. broken example
Remove extraneous intermediate wrapper <div>s between a composite ARIA parent and its required children—or set role="none" on purely structural wrappers.
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("Shopify product tabs & mega-menu pass aria-required-children", async ({ page }) => {
await page.goto("/products/cobalt-ceramic-mug");
const results = await new AxeBuilder({ page })
.withRules(["aria-required-children"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
A predictive-search role='listbox' or header mega-menu role='menubar' inside sections/header.liquid triggers on every Shopify route. Fixing that single Liquid section eliminates the violation across every product and collection URL.
What NVDA and VoiceOver announce
When a container declares role='tablist', role='menu', or role='listbox' without directly owning its required child roles (tab, menuitem, option), assistive technologies break arrow-key navigation, item counts ('1 of 3'), and selection state announcements.
NVDA (Windows)
"Product details, tab control" -> "Specs, button" (item count and selected tab semantics lost)
"Product details, tab control, Specs, tab, selected, 1 of 2"
VoiceOver (macOS / iOS)
"Product details, tab group, 0 items" -> "Specs, button"
"Specs, selected, tab, 1 of 2, Product details, tab group"
Common questions
Why put role='none' on <li> elements inside a <ul role='tablist'>?
Why do Shopify third-party review apps trigger aria-required-children?
Should Shopify header dropdown menus use role='menu'?
Test a URL for aria-required-children
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Managing Shopify Liquid client sites? Monitor 15 sites on one flat plan with white-label portals and branded executive PDFs—$1,140/yr ($95/mo billed annually, 24-month rate lock + onboarding) for Founding 10 agencies.