Accessibility: Empty list elements violate WCAG 1.3.1
p5.js version
1.11.11
What is your operating system?
Mac OS
Web browser and version
Safari: Version 18.6 (20621.3.11.11.3)
Actual Behavior
3 empty <ul class="file-item__children"> elements exist in the DOM,
which violates WCAG 1.3.1 (Info and Relationships).
Screen readers will announce these as empty lists which can cause
confusion for assistive technology users.
Tested on p5.js version 1.11.11 (current default). Not yet verified on v2.0.
Expected Behavior
Empty <ul> elements should either not be rendered,
or have aria-hidden="true" to hide them from
assistive technologies.
Steps to reproduce
Steps:
- Open editor.p5js.org
- Open DevTools Console (Right click → Inspect → Console tab)
- Run the following command:
Snippet:
document.querySelectorAll('ul:empty, ol:empty')
Thank you @raclim for the quick response and assigning this to me. I'll start working on a fix.
Nice catch!
This is something that could also be validated via automated accessibility or E2E tests in the future to prevent regressions.
Happy to help with test coverage around this once the fix is merged.
Hey @raclim, I have fixed this issue and submitted a PR - #4047. Please have a look and let me know if any changes are needed
Closing this one as linked issue has been merged. Thank you @geeta102 !