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

aria-* attributes do not match their roles #1090

Open
ventralnet opened this issue Mar 6, 2025 · 3 comments · May be fixed by #1102
Open

aria-* attributes do not match their roles #1090

ventralnet opened this issue Mar 6, 2025 · 3 comments · May be fixed by #1102
Labels
awaiting triage The issue is not reviewed by the maintainers bug Something isn't working

Comments

@ventralnet
Copy link

ventralnet commented Mar 6, 2025

Hello, I am currently performing accessibility testing for my application. The first step we are doing is running chrome dev tools light house to test our app generally.

It looks like days in the date picker are assigned the role of gridcell. They also have an aria-* rolled defined which I assume is storing the 'pressed' state (aria-pressed="true|false")

This flags as an issue because the mismatch is not to spec/is not a attribute valid for gridcell roles

vue-datepicker@11.0.1

@ventralnet ventralnet added awaiting triage The issue is not reviewed by the maintainers bug Something isn't working labels Mar 6, 2025
@sahilrajthapa
Copy link
Contributor

Hello @ventralnet, you should use :aria-labels props. You can assign a function to the day property of the :aria-labels props to customize the label as needed. You can find example here.

@ventralnet
Copy link
Author

@sahilrajthapa Thanks, I didn't know that prop existed!

However this ticket is because day cells in the calendar are assigned the role 'role=gridcell' and also have the aria attribute 'aria-pressed' defined. Elements of role gridcell do not suppor the aria-pressed attribute. One way to fix this and help scree readers would be to have a child of the gridcells with role=button with the aria-pressed attribute. Another may be to changed aria-pressed to be aria-selected which I think is more standard

@sahilrajthapa
Copy link
Contributor

@ventralnet Thanks for the clarification! I'll create a PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting triage The issue is not reviewed by the maintainers bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants