Skip to content

Extend <router-link> to set an aria-current attribute for active links, instead of an active class #2116

Closed
@rjgotten

Description

What problem does this feature solve?

This feature enables developers to mark up the active router link in an accessible manner for users of assistive technologies.

What does the proposed API look like?

Similar to the active-class property on <router-link> introduce an aria-current string property, defaulting to a null value. When set, use the aria-current DOM attribute in addition to the active class.

Criteria for whether the DOM attribute should be set are the same as for active-class. The attribute should be set on the DOM node itself -- or instead on the special nested <a> element that router-link can upgrade, should one exist.

The DOM attribute's value should be taken from the aria-current router-link property. Optionally, this could be validated against the list of valid options as per the ARIA 1.1 specification and console warnings could be provided on attempts to set invalid values.

Metadata

Assignees

No one assigned

    Labels

    fixed on 4.xThis issue has been already fixed on the v4 but exists in v3group[a11y]Issues regarding accessibility and how to improve overall default experience for screen reader usershas PRimprovement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions