Accessibility: Gallery trigger incorrectly coded as a link and missing accessible name and modal information #43574
Labels
focus: accessibility
The issue/PR is related to accessibility.
focus: shop
Issues related to shop page.
team: Kirigami & Origami
type: community contribution
Prerequisites
Describe the bug
This is the current code for the gallery trigger on single products:
<a href="#" class="woocommerce-product-gallery__trigger">🔍</a>
Links take people to a new page or a new part of a page. Buttons perform actions on a page. Because this opens the gallery modal, this should be a button and not a link.
Additionally, all screen readers say is "magnifying glass" when they reads the emoji. This does not describe what the modal does. It needs an accessible name that describes the button's purpose and information for screen readers that it will open a modal with aria-haspopup.read
Expected behavior
This is better code for this element:
<button class="woocommerce-product-gallery__trigger" aria-label="View full-screen image gallery" aria-haspopup="dialog">🔍</button>
Actual behavior
See above
Steps to reproduce
Go to a single product page and inspect the code for the woocommerce-product-gallery__trigger
WordPress Environment
N/A
Isolating the problem
The text was updated successfully, but these errors were encountered: