Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The aria-current docs aren't clear about how to handle a "current" nav-item that isn't a link-to-current-page. #2583

Open
MichaelAllenWarner opened this issue Jan 17, 2023 · 5 comments
Labels
Feedback Issue raised by or for collecting input from people outside APG task force question Issue asking a question

Comments

@MichaelAllenWarner
Copy link

Describe your concern

It's clear enough that if a link in a set of nav-links goes to the current page, then it should get aria-current="page". However, there are other situations where an item in a navigational structure is somehow "current" (and potentially styled accordingly) but is not a link-to-current-page, and here it's not clear from the docs what should be done.

For example, sometimes a main-nav consists only of top-level links, and the "current" style (if present) then indicates merely that the user is currently on some page within the corresponding section of the site. In this case, aria-current="page" presumably wouldn't be appropriate. Should one use aria-current="location"? Or aria-current="true"? Or no aria-current attribute at all?

Another example would be a multi-level navigational structure, where the current-page-link is nested at the bottom of a "tree." Here, higher-level elements in the current-link's "branch" are also "current" in a way that someone using a screen-reader might appreciate being made aware of. What value (if any) should be used for aria-current on those higher-level "current" items?

I think that fleshing out the aria-current documentation a bit more could help clarify these kinds of situations for developers.

(From what I'm seeing in the sidebar of this W3 page, I'd guess that aria-current="location" is the appropriate attribute to use for the scenarios I described above, but I'm not sure.)

Link to the version of the specification or documentation you were looking at at.

Link to documentation: https://w3c.github.io/aria/#aria-current

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?

Yes

@scottaohara
Copy link
Member

doesn't targeted guidance like this belong in the aria authoring practices?

@MichaelAllenWarner
Copy link
Author

@scottaohara

doesn't targeted guidance like this belong in the aria authoring practices?

Perhaps—and apologies if I posted this in the wrong place.

On the other hand, my concern is that the spec itself is unclear, so maybe this is the right place?

For example, I find the spec's description of the location token ambiguous, especially in light of the general description of aria-current that immediately precedes the list of tokens:

The aria-current attribute is used when an element within a set of related elements is visually styled to indicate it is the current item in the set. For example:
...
• A location token used to indicate the element that is visually styled as the current component, such as within a flow chart.

What does "the current component" mean here? I imagine that "the element that is visually styled as the current component" is meant to be more specific than the generic "element within a set of related elements [that] is visually styled to indicate it is the current item in the set," but to me it doesn't read that way, and I'm left wondering how the location token differs from the generic true token.

@jnurthen jnurthen transferred this issue from w3c/aria Jan 19, 2023
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed ISSUE 2583 The aria-current docs aren't clear about how to handle a "current" nav-item that isn't a link-to-current-page..

The full IRC log of that discussion <Matt_King> TOPIC: ISSUE 2583 The aria-current docs aren't clear about how to handle a "current" nav-item that isn't a link-to-current-page.
<Matt_King> github: https://github.com//issues/2583
<helen> Advice: use 'aria-current="true" but the AT may have the same result as aria-current="page"

@mcking65
Copy link
Contributor

mcking65 commented Feb 7, 2023

@MichaelAllenWarner

The TF recommendation is to use current=true on ancestor pages represented in site navigation structures, e.g. a top-level menu that includes a link to an ancestor page that is styled as current.

@mcking65 mcking65 added question Issue asking a question Feedback Issue raised by or for collecting input from people outside APG task force labels Feb 7, 2023
@mcking65
Copy link
Contributor

mcking65 commented Feb 7, 2023

One open question on this is where the TF recommendation on this question should be communicated in the APG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback Issue raised by or for collecting input from people outside APG task force question Issue asking a question
Projects
None yet
Development

No branches or pull requests

4 participants