Problem/Motivation
The "Local Tasks" bar uses semantic markup for a navigation bar, and behaves like one (clicking one of the links refreshes the page and focus is moved to the top). However the link for the current page has visually hidden text that says "active tab" (which is redundant since the active link also has an aria-current attribute).
Using the language of tabs implies the links should behave like tabs (which they don't): https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
It's important for a component's appearance and semantics to convey the same expected behaviors: https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html
Steps to reproduce
Log in and view a page with local tasks, such as your user profile.

Focus the links with a screen reader, or inspect them in dev tools; the active link has visually hidden text that says "active tab".
Proposed resolution
Remove "active tab" visually hidden text.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Screenshot 2024-03-06 at 12.26.23 PM.png | 311.94 KB | smustgrave |
| #5 | With-patch-shortcut-mobile 2024-03-06 at 5.48.30 PM.png | 193.12 KB | mgifford |
| #5 | With-patch-shortcut 2024-03-06 at 5.48.10 PM.png | 203.73 KB | mgifford |
| #5 | With-patch-view 2024-03-06 at 5.47.23 PM.png | 237.67 KB | mgifford |
| #5 | With-redundant-text-shortcut-mobile 2024-03-06 at 5.45.50 PM.png | 156.63 KB | mgifford |
Issue fork drupal-3424746
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3424746-local-tasks-behaves
changes, plain diff MR !6835
Comments
Comment #2
camilledavis commentedComment #4
camilledavis commentedComment #5
mgiffordI like this idea, but I'm missing something.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
I couldn't find
aria-current="page"in the page.https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
Here's a snapshot of what I see with SimplyTest.me & D10:
I've uploaded some screenshots with/without the patch.
I'd love to know what I am missing.
Comment #6
smustgrave commentedMaybe it's just claro
I'm on 11.x the content view and see aria-current and the visually-hidden
Comment #7
camilledavis commentedI believe aria-current it was added in this issue: https://www.drupal.org/project/drupal/issues/3038523
Comment #8
mgiffordThanks smustgrave - I appreciate you verifying that. I wasn't starting with D11 but obviously should have been here.
That makes sense @camille.davis@civicactions.com
I tested with code without that.
In which case I don't have a problem removing the redundant text.. Who wants redundant text!
Comment #9
rkollerbut talking of the link provided in #7. @larowlan provided a few examples in #3038523-38: Add aria-current attribute to navigation items where the
aria-currentis used. so it isn't only about local tasks but also for menu linkes, breadcrumbs and pagers, or are there even more places? would it make sense to extend the scope of this issue or open up a follow up issue to make things consistent across the board?but overall definitely a good and reasonable change
Comment #10
smustgrave commentedPer #9 I checked pagination and am seeing the same thing. Opened #3426416: Check breadcrumbs, pagination, and menu links for redundant visually hidden to research those other components.
Comment #11
alexpottCommitted and pushed 205d4bfbda to 11.x and dde87be077 to 10.3.x. Thanks!
Backported to 10.3.x so this will be in the next minor release (same as #3038523: Add aria-current attribute to navigation items) since it is a markup change.