Give the quantity spinner buttons an accessible name - #231
Draft
boo-code wants to merge 1 commit into
Draft
Conversation
TouchSpin builds the increase and decrease buttons itself and puts nothing in them but an icon element, so assistive technology and accessibility checkers see two unnamed buttons - "a button is empty or has no value text". The buttons do not exist until TouchSpin has run, so the labels travel on the quantity input as data attributes, where they can be translated, and are applied to the generated buttons right after initialisation. Done for the three places the spinner is built: the product page, the quick view and the cart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aria-label="Increase quantity"/"Decrease quantity". Same in the quick view and on each cart line. Run WAVE or any checker over the page - the "empty button" errors for the quantity control are gone.Measured on the real front office, both directions
The shop was switched to
classicand the page loaded in a browser (the buttons do not exist in theserver HTML - TouchSpin creates them client-side, which is why this cannot be checked with curl):
Hummingbird is already correct - this is classic only
The default 9.x theme renders the buttons in its own template with
aria-label="Decrease quantity of <product name>"andaria-hidden="true"on the icons. Verified on thelive front office. So the report is still valid, but only for the theme it was filed against, and
@matks's 2023 comment that the new theme does better is accurate.
Gates
npm run lint(eslint) clean after fixing two issues it caught: an unused$import in the new helperand
import/order.npm run buildsucceeds;assets/is gitignored in this repo so no built bundle is in the diff.