- First commit to issue fork.
- 🇨🇦Canada mgifford Ottawa, Ontario
- last update
over 1 year ago 30,138 pass, 2 fail - @gauravvvv opened merge request.
- Status changed to Needs work
over 1 year ago 4:02am 14 September 2023 - 🇮🇳India gauravvvv Delhi, India
Added aria-current attribute on pager and breadcrumb. Still needs to be added on menu items.
- 🇺🇸United States cboyden
Rather than each theme needing to implement this, would it be possible to do as Luke.Leber suggests and have the attribute added more globally? It should probably be done anywhere the is-active class is applied to a menu link. For example, in the JS file /core/misc/active-link.es6.js and in the ActiveLinkResponseFilter.php class.
- Merge request !4959Issue #3038523: Add aria-current attribute to navigation items → (Closed) created by cboyden
- last update
about 1 year ago 27,524 pass, 1 fail - Status changed to Needs review
about 1 year ago 8:25pm 6 October 2023 - last update
about 1 year ago 27,488 pass, 1 fail - last update
about 1 year ago Patch Failed to Apply - 🇺🇸United States cboyden
I've created a new MR with the approach of adding the aria-current="page" attribute everywhere (that I can find) that the is-active class is being added to a menu link. I've also created two patches, one for 10.1.x/10.0.x, and one for 9.5.x, in case anyone wants to use them.
According to the ARIA spec for the aria-current attribute, it should be added to a set of navigation links to programmatically indicate the current page among that set of links. It needs to be added to the link, not the list item or other element. And if the current item is not a link, the aria-current attribute is not needed. For reference see https://www.w3.org/TR/wai-aria-1.2/#aria-current and https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut....
- Status changed to Needs work
about 1 year ago 8:55pm 6 October 2023 - 🇺🇸United States irene_dobbs
On the latest patch for 3038523-aria-current-link-core-9.5.x-22.patch and 3038523-aria-current-link-core-10.x-22.patch,
I added menu items to the main navigation and looked at the is-active class and I do not see the aria-current attribute added. - last update
about 1 year ago 30,377 pass, 1 fail - 🇺🇸United States dsnopek USA
I tested the Drupal 9.5 patch from #22, and it worked for me locally! I'm not sure why it didn't work for @irene_dobbs?
However, it looks like this also needs to update
web/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php
because there's a test failure in CI. - last update
about 1 year ago 30,392 pass - Status changed to Needs review
about 1 year ago 10:16pm 10 October 2023 - last update
about 1 year ago 30,341 pass - last update
about 1 year ago 29,654 pass - 🇺🇸United States cboyden
I've updated the MR to include a fix for ActiveLinkResponseFilterTest. I'm also attaching new patches for 9.5.x and 10.1.x/10.0.x.
- Status changed to Needs work
about 1 year ago 1:36pm 11 October 2023 - 🇺🇸United States smustgrave
Before testing the issue summary seem incomplete. Added the template for reference.
- Status changed to Needs review
about 1 year ago 10:49pm 11 October 2023 - Status changed to RTBC
about 1 year ago 3:11pm 12 October 2023 - 🇺🇸United States smustgrave
For clarity I'm hiding the patches as MR 4959 is what would be committed.
Following the steps in the IS I can confirm the links with is-active don't have an aria attribute
Applying the MR
Can confirm the links do have aria-attribute nowWorth noting that the is-active class being set by the toolbar is unaffected with this MR.
- 🇺🇸United States cboyden
Thanks for the review @smustgrave. I took a look at the admin toolbar on the standard install and noted that aria-current is being set to "page" for the active link in the toolbar. To reproduce:
- Install the latest version of Drupal from this issue MR using the standard profile.
- Log in as an administrator.
- In the Manage menu, click Appearance.
- While on the Appearance page, inspect the code for the Appearance link.
- Note the is-active class is set and the aria-current attribute is set.
- Click the Settings tab/link.
- While on the Settings page, inspect the code for the Settings tab/link.
- Note the is-active class is set and the aria-current attribute is set.
- While still on the Settings page, inspect the code for the Appearance tab/link.
- Note the is-active class is set, but the aria-current attribute is NOT set.
- Click the Olivero tab/link.
- While on the Olivero page, inspect the code for the Olivero tab/link.
- Note the is-active class is set and the aria-current attribute is set.
- While still on the Olivero page, inspect the code for the Settings tab/link.
- Note the is-active class is set, but the aria-current attribute is NOT set.
This seems like the appropriate behavior to me - the links in the hierarchy above where you are have the visual styling, but only the actual current page has the aria-current attribute.
- last update
about 1 year ago 30,397 pass - last update
about 1 year ago 30,397 pass - last update
about 1 year ago 30,413 pass - Status changed to Needs review
about 1 year ago 12:12pm 18 October 2023 - 🇫🇮Finland lauriii Finland
Should the
aria-current
attribute be used only on menus or should this also work on other kinds of links too?For example, if I click "Find out more", should that have
aria-current
?
If that's the case, should we do it in a follow-up or should it be done here?
- Status changed to RTBC
about 1 year ago 2:02pm 18 October 2023 - 🇺🇸United States smustgrave
From reading https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
When you have a group of related elements, such as several links in a breadcrumb or steps in a multi-step flow, with one element in the group styled differently from the others to indicate to the sighted user that this is the current element within its group, the aria-current should be used to inform the assistive technology user what has been indicated via styling.
I don't think the Find out more link mentioned would count.
- 🇺🇸United States luke.leber Pennsylvania
I've always believed that ad-hoc self-referencing links can be avoided by a solid content strategy.
...however I did want to raise one other question: what about Single Page Application-type use cases? Is this an outlier, or should we confirm that same page links don't have a fragment?
<!-- None of these should probably have the attribute...? --> <menu> <a href="#">Top</a> <a href="#second">Second section</a> <a href="#third">Third section</a> <a href="#fourth">Fourth section</a> </menu>
17:06 15:30 Running- last update
about 1 year ago 30,425 pass - last update
about 1 year ago 30,426 pass - 🇺🇸United States cboyden
@Luke.Leber because all we're doing is adding the aria-current attribute in places where core is already adding the is-active class, I would hope that the ActiveLinkResponseFilter class would do the right thing with menus that contain anchor links. If core is not already adding the is-active class where it needs adding, or if it's adding the class to multiple anchor links in the same menu, it might be best to fix that in a separate issue.
- last update
about 1 year ago 30,436 pass - last update
about 1 year ago 30,438 pass - last update
about 1 year ago 30,464 pass - last update
about 1 year ago 30,481 pass - last update
about 1 year ago 30,483 pass - last update
about 1 year ago 30,485 pass, 1 fail - last update
about 1 year ago 30,486 pass - last update
about 1 year ago 30,510 pass - last update
about 1 year ago 30,516 pass - last update
about 1 year ago 30,519 pass - last update
about 1 year ago 30,530 pass 2:09 59:51 Running- last update
about 1 year ago 30,602 pass - last update
about 1 year ago 30,604 pass - last update
about 1 year ago 30,605 pass - last update
about 1 year ago 30,668 pass - last update
about 1 year ago 30,675 pass - last update
about 1 year ago 30,679 pass - last update
about 1 year ago 30,686 pass - last update
about 1 year ago 30,688 pass - last update
about 1 year ago 30,688 pass 32:08 27:33 Running- last update
about 1 year ago 30,698 pass - last update
about 1 year ago 30,702 pass - last update
about 1 year ago 30,712 pass - last update
about 1 year ago 30,764 pass - last update
about 1 year ago 30,766 pass - last update
about 1 year ago 25,905 pass, 1,795 fail - last update
about 1 year ago 25,871 pass, 1,812 fail - last update
12 months ago 25,935 pass, 1,808 fail - last update
12 months ago 25,944 pass, 1,836 fail - last update
12 months ago 25,927 pass, 1,804 fail - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
larowlan → changed the visibility of the branch 3038523-add-aria-current-attribute to hidden.
-
larowlan →
committed a060dbd0 on 11.x
Issue #3038523 by cboyden, Gauravvvv, mgifford, Luke.Leber, Chi: Add...
-
larowlan →
committed a060dbd0 on 11.x
- Status changed to Fixed
12 months ago 9:28pm 28 December 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Took this for a manual test, tested menu links, breadcrumbs, local tasks, pagers. All looked good.
Read the MDN spec on it and it looks like we're doing things the correct way.
Committed to 11.x
Added and published a change-record
- 🇮🇪Ireland frankdesign
Thanks for fixing this for D11. Is there any chance that the patch will be updated for D10.2 (the patch at #25 fails to apply)
- 🇺🇸United States cboyden
The 10.0/10.1 patch still applies manually to 10.2.x with a bunch of offsets. I've uploaded a new version that should apply to 10.2.x cleanly.
- last update
12 months ago 25,781 pass, 1,817 fail - last update
12 months ago 25,812 pass, 1,788 fail Automatically closed - issue fixed for 2 weeks with no activity.
- 🇺🇸United States aaronpinero
Thank you @cboyden for the 10.2.x patch. I have applied this to my v10.2.5 Drupal site using composer. The patch applied cleanly and appears to provide the expected a11y enhancement.
- 🇺🇸United States chri5tia PDX
I checked out the patch #40 for 10.2.x to reroll it for 10.3 and all the changes seem to be in core, though I don't see it noted. In case this is helpful to anyone else.