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

fix(a11y): add aria-current="page" attribute to links #20413

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

paul-thebaud
Copy link
Contributor

Description

This PR adds an aria-current="page" attribute to VBtn, VCard, VChip, VListItem and VBreadcrumbsItem when active value from router is true.

closes #20399

@paul-thebaud paul-thebaud force-pushed the fix/20399-aria-current-anchor branch from daae92a to b1b3285 Compare September 2, 2024 09:32
@paul-thebaud paul-thebaud force-pushed the fix/20399-aria-current-anchor branch from b1b3285 to c2a991e Compare September 2, 2024 09:38
@paul-thebaud paul-thebaud marked this pull request as ready for review September 2, 2024 09:46
@KaelWD KaelWD enabled auto-merge (squash) September 3, 2024 07:16
href,
linkProps: reactive({
href,
ariaCurrent: computed(() => isActive.value ? 'page' : undefined),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aria-current should use kebab case name, because vue 3 won't concert it automatically.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot_20240903_171939

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it depends on the attribute, HTMLElement.ariaCurrent exists so it works but others might not: vuejs/core#5477

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chrome automatically converts attributes, but Firefox doesn't. There is an open issue about it on vuetify and vue repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.7.0] aria-current="page" should be defined on active links in addition to active classes
2 participants