# SOLVED: WooCommerce Variation swatches a11y regression in 2.3.3

**URL:** <https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012>\
**Category:** Bugs\
**Tags:** v2-3-3\
**Created:** [April 24, 2026, 6:02pm UTC](https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012 "2026-04-24T18:02:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drigis3](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/drigis3/32/2338_2.png) [@drigis3](https://forum.bricksbuilder.io/u/drigis3)\
**Post date:** [April 24, 2026, 6:02pm UTC](https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012/1 "2026-04-24T18:02:16Z")

</div>

After the “Variation Swatches Keyboard accessibility” changes in 2.3.3, my PageSpeed Insights accessibility score dropped from 100 to 97 on WooCommerce product pages. Axe-core flags the swatch `<ul>` with:

> Lists do not contain only `<li>` elements and script supporting elements (`<script>` and `<template>`).

**Two issues in the current markup:**

```auto
<ul class="bricks-variation-swatches bricks-swatch-label">
  <li role="button" aria-pressed="false" tabindex="0" data-value="0-5-kg" aria-label="0.5 kg">0.5 kg</li>
  <li role="button" aria-pressed="true" tabindex="0" data-value="1-kg" aria-label="1 kg" class="bricks-swatch-selected">1 kg</li>
  <input type="hidden" name="attribute_pa_size" class="variation-select" value="1-kg">
</ul>

```

1. `role="button"` on `<li>` overrides the implicit `listitem` role.

2. `<input type="hidden">` is placed as a direct child of `<ul>`, which isn’t a valid list child.

**Environment:** Bricks 2.3.3, WooCommerce 10.7.0, WordPress 6.9.4

**Impact:** Affects all Bricks + WooCommerce sites using variation swatches.

 ![Screenshot 2026-04-23 at 21-13-32 PageSpeed Insights](https://forum.bricksbuilder.io/uploads/default/original/3X/c/a/ca2ecf0d546070f8c67eb562233d7fe1ca6454d6.png)

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [April 27, 2026, 6:40am UTC](https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012/2 "2026-04-27T06:40:30Z")

</div>

Thanks so much for creating a separate report on this!

I can replicate the problem and have added it to the internal bug tracker. We will update this thread as soon as it is fixed.

Best regards,  
timmse

---

<div class="post-metadata">

**Author:** ![Habeeb](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/h/e36b37/32.png) [@Habeeb](https://forum.bricksbuilder.io/u/Habeeb)\
**Post date:** [May 11, 2026, 5:19pm UTC](https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012/3 "2026-05-11T17:19:10Z")

</div>

thats wild i was sent by Claude here. wow

There’s an active forum thread on exactly this. Let me read it to see what the community/Bricks team is recommending.

Fetched: WIP: WooCommerce Variation swatches a11y regression in 2.3.3

Fetched: WIP: WooCommerce Variation swatches a11y regression in 2.3.3

![](https://www.google.com/s2/favicons?domain=bricksbuilder.io&sz=32)

[WIP: WooCommerce Variation swatches a11y regression in 2.3.3](https://forum.bricksbuilder.io/t/woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012)

[forum.bricksbuilder.io](https://forum.bricksbuilder.io/t/woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012)

Done

This confirms what’s going on. The Bricks team has acknowledged this as a confirmed bug (added to internal tracker) on April 27, 2026, with no fix released yet. Two issues actually: the `<input>` inside `<ul>`, AND `role="button"` on `<li>` overriding the listitem role. [Bricks Community Forum](https://forum.bricksbuilder.io/t/woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012)

So your PHP filter approach is correct in concept — the issue is that your regex breaks Bricks’ swatch JS. Bricks’ frontend script almost certainly does something like `ul.querySelector('.variation-select')` to read/write the selected variation when a swatch is clicked. Moving the input outside breaks that lookup.

The cleanest fix is to do it in the **DOM after Bricks initialises** — let Bricks find the input where it expects it, then relocate it. That way the swatch click handler has already wired itself up.

Here’s a better approach. Drop this into a WPCode snippet (PHP, site-wide, footer) or your child theme:

php

```auto
<?php
/**
 * Fix Bricks variation swatches a11y issues:
 * 1. <input class="variation-select"> placed inside <ul> (invalid list child)
 * 2. role="button" on <li> overrides implicit listitem role
 *
 * We DON'T filter the PHP output — Bricks' JS queries the input via the <ul>.
 * Instead, after Bricks wires up its swatch handlers, we:
 * - move the input to be a sibling AFTER the <ul>
 * - remove role="button" from <li> (the <li> keeps tabindex + aria-pressed,
 * which is enough; screen readers will announce it as a list item that
 * behaves like a toggle button via aria-pressed)
 *
 * Re-runs on every WooCommerce variation form refresh.
 */
add_action( 'wp_footer', function () {
	if ( ! function_exists( 'is_product' ) || ! is_product() ) {
		return;
	}
	?>
	<script id="bricks-swatch-a11y-fix">
	(function () {
		function fixSwatches(root) {
			var lists = (root || document).querySelectorAll('ul.bricks-variation-swatches');
			lists.forEach(function (ul) {
				// 1) Move hidden <input class="variation-select"> out of <ul>.
				var input = ul.querySelector(':scope > input.variation-select');
				if (input && ul.parentNode) {
					ul.parentNode.insertBefore(input, ul.nextSibling);
				}

				// 2) Strip role="button" off <li>; keep tabindex/aria-pressed/aria-label.
				ul.querySelectorAll('li[role="button"]').forEach(function (li) {
					li.removeAttribute('role');
				});
			});
		}

		// Initial pass.
		if (document.readyState === 'loading') {
			document.addEventListener('DOMContentLoaded', function () { fixSwatches(); });
		} else {
			fixSwatches();
		}

		// Re-run when Woo re-renders the variations form (price/availability updates,
		// reset link, AJAX add-to-cart plugins, etc.).
		if (window.jQuery) {
			jQuery(document.body).on(
				'woocommerce_update_variation_values found_variation reset_data show_variation',
				function () { fixSwatches(); }
			);
		}
	})();
	</script>
	<?php
}, 99 );

```

but i will rather wait for the patch fix.

---

<div class="post-metadata">

**Author:** ![Habeeb](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/h/e36b37/32.png) [@Habeeb](https://forum.bricksbuilder.io/u/Habeeb)\
**Post date:** [June 13, 2026, 10:54am UTC](https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012/4 "2026-06-13T10:54:55Z")

</div>

Was really hopping this issue would have been fixed on this update.

 ![image](https://forum.bricksbuilder.io/uploads/default/original/3X/6/6/66882328faa350398bed85d07726d67d725deed9.png)

---

<div class="post-metadata">

**Author:** ![bricks.assistant](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/bricks.assistant/32/32537_2.png) [@bricks.assistant](https://forum.bricksbuilder.io/u/bricks.assistant)\
**Post date:** [August 12, 2026, 9:01am UTC](https://forum.bricksbuilder.io/t/solved-woocommerce-variation-swatches-a11y-regression-in-2-3-3/39012/5 "2026-08-12T09:01:57Z")

</div>

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

Please read the [changelog entry](https://bricksbuilder.io/release/bricks-2-3-11/) before updating, and let us know if you experience any issues.
