Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product A11Y: Fix invalid HTML and announce price when updating variants #794

Merged
merged 4 commits into from
Oct 21, 2021

Conversation

LucasLacerdaUX
Copy link
Contributor

Why are these changes introduced?
Accessibility fixes for Product page and Featured Product sections:

  • Fix invalid HTML markup
  • Add role="status" to price container so the price is announced when variants are updated

Fixes #126
Fixes #463

What approach did you take?
Followed suggestions on the issues.

To fix invalid HTML:

  • Replaced option.name with option.position on the radio button ids. option.name can have spaces, resulting in a space separated (invalid) id attribute.
  • Updated all form attributes to use the same {{ product_form_id }} to keep consistency.
  • Updated disabled="true" (invalid) to disabled="disabled" (valid) in all JS files that are using this property

To announce price variants:

  • Removed aria-hidden from badges in price.liquid.
  • Added role="status" to the price region.

Demo links

Suggested Tests
Accessibility

  • Use a Screen Reader to test if prices are announced when the variant price or availability changes. Suggested product.

Functionality

  • Check if Product form still works as expected in products with multiple variants on the product page and featured product section.

Checklist

Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

assets/global.js Show resolved Hide resolved
@kmeleta kmeleta self-requested a review October 21, 2021 21:06
Copy link
Contributor

@kmeleta kmeleta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Tested in VO 👍

@LucasLacerdaUX LucasLacerdaUX merged commit 85753c2 into main Oct 21, 2021
@LucasLacerdaUX LucasLacerdaUX deleted the accessibility-fixes-product branch October 21, 2021 23:36
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Product] Change of status on variant selection not announced [Product] Invalid HTML markup
4 participants