Problem/Motivation
Follow up to: https://www.drupal.org/project/drupal/issues/2952488
<nav class="pager" role="navigation" aria-labelledby="pagination-heading">
<h4 id="pagination-heading" class="visually-hidden">Pagination</h4>
<ul class="pager__items js-pager__items">
<li class="pager__item is-active">
<a href="?page=0" title="Current page" aria-current="Current page">
<span class="visually-hidden">
Current page
</span>1</a>
</li>
The aria-current implementation uses, "Current page" which is not a valid value.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
Steps to reproduce
When accessing a pagination page, the pager will show an accessibility failure because aria-current is not an acceptable value.
Proposed resolution
use an appropriate value. For the current page, this would be, aria-current="page"
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | interdiff_10-12.txt | 721 bytes | kostyashupenko |
| #12 | 3384679-12.patch | 1.54 KB | kostyashupenko |
| #11 | 3384679-nr-bot.txt | 1.6 KB | needs-review-queue-bot |
| #10 | interdiff-7_10.txt | 607 bytes | gauravvvv |
| #10 | 3384679-10.patch | 1.31 KB | gauravvvv |
Comments
Comment #2
neclimdulLooks like "page" was used in the original implementation but something changed between #93 and #96 that changed the value. Probably by accident?
Comment #3
neclimdulComment #4
mgiffordWell yes, that's not right. Should be a true/false value https://www.w3.org/TR/wai-aria-1.2/#aria-current
Also related issue:
https://www.drupal.org/project/drupal/issues/3038523
Comment #5
gauravvvv commentedI have added the aria-current="page", attached patch for same. Reference mozilla docs
Comment #7
gauravvvv commentedFixed the failed test. attached interdiff for same
Comment #8
smustgrave commentedSeems like a simple enough fix.
Comment #9
neclimdulPretty sure since it's an explicit value from the aria spec it should not be translated. That would lead to weird behaviors on translated sites.
Comment #10
gauravvvv commentedRemoved translation from aria attr, attach interdiff for same.
Comment #11
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #12
kostyashupenkoFixed errors reported by bot
Comment #13
neclimdulLGTM
Comment #16
lauriiiCommitted d6a990b and pushed to 11.x. Cherry-picked to 10.1.x as a non-disruptive bug fix. Thanks!