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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): add aria-current to active links (close #2116) #3073

wants to merge 1 commit into
base: dev


Copy link

smhigley commented Dec 21, 2019

Hi! First contributor + pretty new to Vue 馃憢 馃槃

This PR adds aria-current="page" to active links, and resolves #2116. I made the following two choices:

  1. Use aria-current="page" over other token values
    The original issue mentions allowing custom token values, or future <router-link> extension possibilities. That still seems useful, but aria-current="page" seems like the right choice at least 90% of the time. The other tokens are either much less common (e.g. step) or unlikely to be used with a router at all (e.g. date)

  2. Use the activeClass logic over only applying it to the exact active route
    This is more hand-wavy, but seems like the better choice -- URL params shouldn't necessarily affect aria-current, and it's not the worst thing to have parent routes also receive aria-current if exact is not applied.

I'm hoping this is a small enough change that it can go in before the harder work of figuring out how to extend <router-link> is done, and it seems like a sensible default even with customization. I've run into some issues using vue-router b/c of this, so I'd personally love to see aria-current added :). I'm happy to answer any questions on the accessibility side, and let me know if I missed anything PR-wise. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Awaiting triage
1 participant
You can鈥檛 perform that action at this time.