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

[A11y] refactor(ProductList): improve structure and accessibility #9795

Conversation

TylerAPfledderer
Copy link
Contributor

Description

Improves accessibility navigating the ProductList component with a screen reader.

  • Applies the use of Chakra's List and ListItem components.
  • Connects the list with it's heading via aria-labelledby to ensure the user knows what the list should they skip the heading
  • Adds hidden text for the button link to let the user know that it's a link to an external site. (This component will already read out "opens a new tab")

NOTE: Using the screen reader NVDA for testing

Secondary addition to the PR

This PR also updates the layout to provide more consistency with spacing.

  • Keeps the button link the same width in all instances.
  • Keeps the each item an equal height if two lists are rendered side-by-side.

cc @nloureiro for approval on this

Related Issue

Closes #8878

@gatsby-cloud
Copy link

gatsby-cloud bot commented Mar 25, 2023

✅ ethereum-org-website-dev deploy preview ready

@github-actions github-actions bot added content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies documentation 📖 event 📅 This issue or pull request is related to an event listing tooling 🔧 Changes related to tooling of the project translation 🌍 This is related to our Translation Program labels Jun 5, 2023
@TylerAPfledderer TylerAPfledderer force-pushed the refactor/product-list-a11y-and-layout branch 2 times, most recently from d04dd48 to 6377bc0 Compare June 5, 2023 20:32
@@ -22,10 +31,13 @@ export interface IProps {
const ProductList: React.FC<IProps> = ({ content, category }) => {
const shadow = useColorModeValue("tableBox.light", "tableBox.dark")

const ariaLabelledby = "cat-name"
Copy link
Member

Choose a reason for hiding this comment

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

I just had a question abut this label. Im a little confused what "cat-name" is. Should the be "category-name", or should we actually be passing the category prop instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just an id because it is being used in two places (lines 40 and 51) for the aria-labelledby feature.

I can be clearer here in using a more verbose id, along with uppercase variable naming to denote this as a const variable 😁

Copy link
Member

Choose a reason for hiding this comment

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

Sure! I pushed those changes up. This should be good to go now :)

@corwintines corwintines merged commit c397829 into ethereum:dev Jul 4, 2023
@TylerAPfledderer TylerAPfledderer deleted the refactor/product-list-a11y-and-layout branch July 4, 2023 14:34
@corwintines corwintines mentioned this pull request Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies event 📅 This issue or pull request is related to an event listing tooling 🔧 Changes related to tooling of the project translation 🌍 This is related to our Translation Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A11y Refactor: ProductList Component
2 participants