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

Accessibility refinement – aria-expanded attribute on container element #75

Closed
simonminter opened this issue Mar 8, 2024 · 1 comment

Comments

@simonminter
Copy link
Contributor

Working on a project that included showmore.js, automated accessibility tests (carried out with Axe) were failing, with the "Elements must only use allowed ARIA attributes" issue.

This seemed to be due to the aria-expanded attribute being applied to the showmore container element as well as the showmore-generated button element. Looking at https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded, the aria-expanded attribute should be added to the button element, which is happening correctly, but it does not need to be added to the container element.

The addition of aria-expanded on the container is used by code to affect behaviour, so if it is replaced with a different/custom attribute, the functionality will continue to work, without triggering an accessibility test failure.

@simonminter
Copy link
Contributor Author

Pull request for a fix is here: #76

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