How to fix aria required attr on Adobe Commerce (Magento)

Add all required ARIA attributes (such as aria-expanded and aria-controls) to every interactive element that uses an ARIA role, so assistive technologies can communicate widget state to users.

Steps for Adobe Commerce (Magento)

  1. Identify the PHTML template or UI Component responsible for the flagged element — common locations are Magento_Theme/templates/html/header.phtml, Magento_Catalog/templates/navigation/top.phtml, or a third-party module's template.
  2. Open the file via app/design/frontend/[Vendor]/[theme]/[Module_Name]/templates/ (always work in a custom theme, never core files).
  3. Add aria-expanded='false' and aria-controls='target-element-id' to the trigger element in the template.
  4. Locate the corresponding requireJS module (usually lib/web/mage/menu.js or a custom module's JS) and in the toggle/activate method add: $(trigger).attr('aria-expanded', isOpen ? 'true' : 'false');
  5. Run bin/magento setup:static-content:deploy and flush the cache (bin/magento cache:flush), then test with the axe extension.
Official Adobe Commerce (Magento) documentation ↗

What is aria required attr?

ARIA (Accessible Rich Internet Applications) roles tell screen readers and other assistive technologies what kind of widget an element is — for example, a button that opens a dropdown, a tab panel, or an accordion. Each ARIA role has a defined set of required attributes that must also be present for the widget to make sense. For instance, a button that expands a menu must include `aria-expanded` (so the screen reader can announce "expanded" or "collapsed") and typically `aria-controls` (so it points to the element it controls). When those required attributes are missing, the role declaration is incomplete and the assistive technology cannot convey the correct state or relationship to the user.

Screen reader users — who often navigate by keyboard only — rely entirely on ARIA state attributes to know whether a menu is open, a tab is selected, or an accordion panel is visible. Without `aria-expanded`, a screen reader user has no way to know whether a dropdown they just activated is open or closed. Without `aria-controls`, they may not find the content that just appeared. This directly breaks the shopping experience for blind and low-vision customers. WCAG 2.x Success Criterion 4.1.2 (Name, Role, Value) is a Level AA requirement, meaning it is referenced in most accessibility laws worldwide (ADA, Section 508, EN 301 549, AODA). Failing it exposes your store to legal complaints and demand letters. It also signals to Google's quality systems that the site has usability issues, which can indirectly affect organic rankings.

See the complete Aria required attr guide for every platform and the full background.

Not sure if your Adobe Commerce (Magento) store has this?

Run a free SEOLZ scan — we’ll find aria required attr and every other issue across your whole site.

Scan my site free

Fix aria required attr on another platform