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] Correct role attribute for package lists #9303

Merged
merged 3 commits into from
Nov 11, 2022

Conversation

advay26
Copy link
Member

@advay26 advay26 commented Nov 9, 2022

Addresses #9301

Problem:

On the Profiles page and the List Packages page, the lists of packages were flagged for not having the appropriate role on the individual list items. These were already marked with role="listitem" and the enclosing div was marked with role="list", so I'm unsure why this was flagged. However, we can bypass the need for these manual role attributes by using <ul> and <li> tags directly instead.

Previously,
image

Fix:

These package lists now use <ul> and <li> tags, which do not require additional role attributes. I also had to remove the bullet and left padding from these package list <ul>s.

After the changes,
image

@advay26 advay26 requested a review from a team as a code owner November 9, 2022 00:14
@joelverhagen
Copy link
Member

This view is shared by the main search page. Could you run FastPass on that page too? Looks good by the way. It sort of makes sense. It's a list of package results :)

joelverhagen
joelverhagen previously approved these changes Nov 9, 2022
Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

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

Check FastPass on other pages that use this shared view then :shipit:

ryuyu
ryuyu previously approved these changes Nov 9, 2022
Copy link
Contributor

@ryuyu ryuyu left a comment

Choose a reason for hiding this comment

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

Same as what @joelverhagen said. Let's run a pass over the other places that share this view, and we are good to go. Looks great!

@advay26 advay26 dismissed stale reviews from ryuyu and joelverhagen via eb51cf0 November 9, 2022 21:18
@advay26
Copy link
Member Author

advay26 commented Nov 9, 2022

I found a separate issue with the "There are X packages" heading on the Search page, where it was inappropriately labeled as an 'alert'. Labeling it a 'heading' fixes this, and just fits better too. FastPass passes on both, the Search pages and the Profiles pages now.

Previously, (2 separate issues: (1) 'alert' heading, (2) the list items)
image

After the changes,
image

@@ -41,7 +41,7 @@
<section role="main" class="container main-container page-list-packages">
<div class="row clearfix no-margin">
<div class="col-md-10 no-padding">
<h1 role="alert">
<h1 role="heading">
Copy link
Member

Choose a reason for hiding this comment

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

Is role="heading" necessary for h1 tags?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, it wasn't necessary, the screen reader announces h1 tags as headings anyway. I removed the header role from this element. I also added tabindex=0 to this element so that screen readers can read the heading, which they were skipping previously.

@advay26 advay26 merged commit 429d3a0 into dev Nov 11, 2022
@advay26 advay26 deleted the dev-advay26-a11y-listitems branch November 11, 2022 22:51
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.

4 participants