cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

feat(storefront): BCTHEME-145 Add presentation role for table on cart page

Open bc-alexsaiannyi opened this issue 4 years ago • 7 comments

What?

@BC-tymurbiedukhin @yurytut1993 this PR adds a presentation role for table to prevent inaccurate screen reader output

Tickets / Documentation

Add links to any relevant tickets and documentation.

Screenshots (if appropriate)

Table role added

bc-alexsaiannyi avatar Aug 13 '20 08:08 bc-alexsaiannyi

Autotagging @bigcommerce/storefront-team @davidchin

bigbot avatar Aug 13 '20 08:08 bigbot

@bc-alexsaiannyi , Why is role=presentation being added if the cart does in fact show tabular data?

mattcoy-arcticleaf avatar Aug 13 '20 17:08 mattcoy-arcticleaf

@bc-as Could you please answer this question? ^

BC-tymurbiedukhin avatar Aug 14 '20 06:08 BC-tymurbiedukhin

@mattcoy-arcticleaf, according to the story table tag for Cart content has been used due to layout reasons and adding a presentation role is aimed to ensure accurate reading in screen readers and remove any semantic meaning from the table element.

bc-alexsaiannyi avatar Aug 14 '20 08:08 bc-alexsaiannyi

@bc-alexsaiannyi , can you confirm that the screen-reader experience is better with this addition? In my understanding, the table functions as a table, and thus should not be presentation. The real fix here might be adding scope="col" to the th elements.

mattcoy-arcticleaf avatar Aug 14 '20 14:08 mattcoy-arcticleaf

@mattcoy-arcticleaf, sure, I can confirm it. Applying presentation role removes all announcements regarding table like entering/leaving table, number of columns and rows etc. It makes information cleaner for Users so they can only hear related to Cart content things which can be interacted with.

bc-alexsaiannyi avatar Aug 14 '20 16:08 bc-alexsaiannyi

@bc-alexsaiannyi https://www.w3.org/TR/WCAG20-TECHS/F92.html

mattcoy-arcticleaf avatar Aug 14 '20 21:08 mattcoy-arcticleaf