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

Incorrect use of the aria-controls attribute in the widget #592

Open
JamaiKai opened this issue Jan 6, 2025 · 2 comments
Open

Incorrect use of the aria-controls attribute in the widget #592

JamaiKai opened this issue Jan 6, 2025 · 2 comments

Comments

@JamaiKai
Copy link

JamaiKai commented Jan 6, 2025

Description:
The widget provides many improvements regarding accessibility but does not use the ARIA aria-controls attribute correctly.

Problem:
The aria-controls attribute does not reference a valid target in the DOM structure. As a result, users of assistive technologies (e.g., screen readers) cannot identify which element is being controlled. This reduces usability and violates WCAG guidelines.

Expected Behavior:
The aria-controls attribute should reference the id of an existing and relevant DOM element that is being controlled by the interaction.

Steps to Reproduce:
https://codepen.io/jamaikai/pen/VYZypLd
Open the widget.
Inspect the element containing the aria-controls attribute.
Check whether the value of the aria-controls attribute matches the id of an existing DOM element.
Note that the target element is missing or does not exist.
Impact:

Assistive technologies cannot identify the relationship between the controls and the controlled content.
Reduced accessibility for users relying on screen readers.
Proposed Solution:
Ensure that the aria-controls attribute references a valid DOM element. If no such element exists, remove the attribute or adjust the widget’s design accordingly.

Additional Information:
Link to the ARIA specifications for aria-controls
Screenshot or code snippet illustrating the issue (if applicable).

@brianvoe
Copy link
Owner

brianvoe commented Jan 6, 2025

https://github.com/brianvoe/slim-select/blob/master/src/slim-select/render.ts#L165

Looks like the aria-controls might have not been getting set.

@JamaiKai
Copy link
Author

JamaiKai commented Jan 7, 2025

yes, I tried to figure out why, but this.content.main.id is always empty because it is not set on the container

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

No branches or pull requests

2 participants