Extend <router-link> to set an aria-current attribute for active links, instead of an active class #2116
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.