SOLVED: Variation swatches: role="button" on <li> still fails axe "list" rule

Follow-up to SOLVED: WooCommerce Variation swatches a11y regression in 2.3.3. That report had two issues; 2.3.11 fixed the input inside the <ul> (thanks), but the second one is still there, so the axe list rule still fails. Old thread is closed, hence a new one.

Environment: Bricks 2.3.12, WooCommerce 10.9.4, WordPress 7.1. Clean install, no custom code.

html

<ul class="bricks-variation-swatches bricks-swatch-label">
  <li data-value="0-5-kg" role="button" aria-pressed="false" tabindex="0" aria-label="0.5 kg">0.5 kg</li>
  …
</ul>

Lighthouse still reports “Lists do not contain only <li> elements…”. axe’s only-listitems check resolves each child’s role, not just its tag — role="button" overrides the implicit listitem role, so the list counts as containing non-list content. Removing the input was necessary but not sufficient.

Hi Aivaras,
Thanks for the report. We were able to replicate this issue and added it to our internal bug tracker. We’ll update this thread once it’s fixed.

We’ve addressed this in Bricks 2.3.13, now available as a one-click update in your WordPress Dashboard.

Variation swatches now preserve the list semantics required by accessibility checks.

Please read the changelog entry before updating, and let us know if you experience any issues.