p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Accessibility: Empty list elements violate WCAG 1.3.1

Open geeta102 opened this issue 8 months ago • 4 comments

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:

  1. Open editor.p5js.org
  2. Open DevTools Console (Right click → Inspect → Console tab)
  3. Run the following command:

Snippet:

document.querySelectorAll('ul:empty, ol:empty')

Image

geeta102 avatar Mar 26 '26 13:03 geeta102

Thank you @raclim for the quick response and assigning this to me. I'll start working on a fix.

geeta102 avatar Mar 26 '26 15:03 geeta102

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.

sanchit955 avatar Mar 26 '26 16:03 sanchit955

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

geeta102 avatar Mar 28 '26 05:03 geeta102

Closing this one as linked issue has been merged. Thank you @geeta102 !

ksen0 avatar May 01 '26 13:05 ksen0