department-of-veterans-affairs / vets-design-system-documentation

Repository for design.va.gov website
https://design.va.gov
36 stars 55 forks source link

USWDS v3 - Pagination - Accessibility review #1440

Closed caw310 closed 9 months ago

caw310 commented 1 year ago

Issue Description

We need to conduct a full accessibility review of the Pagination component. The component can be viewed here: https://design.va.gov/components/pagination

USWDS https://designsystem.digital.gov/components/pagination/

Tasks

Acceptance Criteria

laflannery commented 1 year ago

I was investigating an axe issue flagged for pagination and was routed to this ticket so I wanted to note the issue and possible solution as it does relate to accessibility:

Issue: The ellipsis that is currently being used for presentation to truncate the pagination is done using <li role=presentation> in the code. This is being flagged in axe for

<ul> and <ol> must only directly contain <li>, <script> or <template> elements.

After investigating I found that this seems to be a common pattern, we do it here, it is done in the USWDS component and it is done in Drupal. and they all get flagged for the same issue.

Besides the axe issue, using role presentation in this way could cause confusion for 2 reasons when screen reader users are reading through the navigation (not tabbing through but reading through):

  1. At the start of the list, the number of items in the list will be read out and the ellipsis item will not be counted in the total which may be confusing as there is now 1 more element than they were expecting when going through.
  2. When reading through, the ellipsis element is blank, it’s silent. If the user is reading one item at a time, they may wonder what has happened if they are on an item and nothing is being announced.

Proposed solution:

  1. Remove the role presentation from the <li> containing the ellipsis
  2. Within that same <li>, add a <span> that can be visually hidden, with text that says “Skipping pages X to XX” (whichever page numbers have been truncated).
mgifford commented 1 year ago

There are some parallel efforts going on with the USWDS and now Drupal — thanks @laflannery 

uswds/uswds#5022

Would be good to prioritize this and come up with a common solution that not only addresses axe's concerns, but those of users as well.

caw310 commented 9 months ago

This will carry over into sprint 36 due to sick leave.

rsmithadhoc commented 9 months ago

Issues

I labeled each as Must, Should, Consider to rank the severity of the issue.

Axe Scan

Visual, Color and Color Contrast

Zoom and Window Size

Screen Reader

rsmithadhoc commented 9 months ago

I created the following tickets to address these issues: