Commit 8fed97d8697 for woocommerce
commit 8fed97d869744df29e9a710514e3b5fd9bd924a0
Author: TORANOSUKE TANIGAKI <155611269+Toraastrta@users.noreply.github.com>
Date: Fri Nov 20 21:34:13 2026 +0900
Add role="listitem" to Variation Selector attribute rows (#71118)
* Add role="listitem" to Variation Selector attribute rows
The Variation Selector wrapper has role="list", but render_attribute_row()
builds each row's wrapper itself and dropped the role="listitem" that the
saved block markup has, so the list had no items (axe
aria-required-children). Fixes #71031.
* Remove unnecessary test
* Add block name to changelog
---------
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
diff --git a/plugins/woocommerce/changelog/fix-variation-selector-listitem-role b/plugins/woocommerce/changelog/fix-variation-selector-listitem-role
new file mode 100644
index 00000000000..21e2d34a744
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-variation-selector-listitem-role
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Add to Cart + Options: Mark each Variation Selector attribute row as a list item, so screen readers no longer announce an empty list.
diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/VariationSelectorAttribute.php b/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/VariationSelectorAttribute.php
index 9f6f0a6f883..ad558c09c35 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/VariationSelectorAttribute.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/VariationSelectorAttribute.php
@@ -127,6 +127,7 @@ class VariationSelectorAttribute extends AbstractBlock {
);
$interactive_attributes = array(
+ 'role' => 'listitem',
'data-wp-interactive' => 'woocommerce/add-to-cart-with-options',
'data-wp-init' => 'callbacks.setDefaultSelectedAttribute',
);