Closed caw310 closed 9 months 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):
Proposed solution:
<li>
containing the ellipsis<li>
, add a <span>
that can be visually hidden, with text that says “Skipping pages X to XX” (whichever page numbers have been truncated).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.
This will carry over into sprint 36 due to sick leave.
I labeled each as Must, Should, Consider to rank the severity of the issue.
[role=presentation]
<li class="usa-pagination__item usa-pagination__overflow" aria-label="ellipsis indicating non-visible pages" role="presentation"><span>...</span></li>
role=presentation
. The presentation attribute hides that element's semantics from assistive technology. For this <li>
, it would no longer be considered a list item. I believe it should be a list item, so those using assistive technology are able to see that there is a gap in page numbers. See ARIA: presentation role and axe-core 4.6 for more information.<nav>
elements are on the same page, they should be given a unique name for accessibility.
aria-label="pagination"
to the <nav>
element.I created the following tickets to address these issues:
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