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

Comments

PickyOrder created an issue. See original summary.

neclimdul’s picture

Looks like "page" was used in the original implementation but something changed between #93 and #96 that changed the value. Probably by accident?

neclimdul’s picture

Title: aira-current is giving an invalid value » aria-current is giving an invalid value
mgifford’s picture

Issue tags: +Accessibility, +aria

Well 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

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new640 bytes

I have added the aria-current="page", attached patch for same. Reference mozilla docs

Status: Needs review » Needs work

The last submitted patch, 5: 3384679-5.patch, failed testing. View results

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB
new731 bytes

Fixed the failed test. attached interdiff for same

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems like a simple enough fix.

neclimdul’s picture

Status: Reviewed & tested by the community » Needs work

Pretty 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.

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new1.31 KB
new607 bytes

Removed translation from aria attr, attach interdiff for same.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.6 KB

The 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.

kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new1.54 KB
new721 bytes

Fixed errors reported by bot

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

LGTM

  • lauriii committed d6a990b8 on 11.x
    Issue #3384679 by Gauravvvv, kostyashupenko, neclimdul, PickyOrder,...

  • lauriii committed d6127804 on 10.1.x
    Issue #3384679 by Gauravvvv, kostyashupenko, neclimdul, PickyOrder,...
lauriii’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed d6a990b and pushed to 11.x. Cherry-picked to 10.1.x as a non-disruptive bug fix. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.