DEV Community

Discussion on: Dropdowns Without Javascript

Collapse
 
equinusocio profile image
Mattia Astorino

Another issue is accessibility. Browser and e-readers doesn’t recognise this as dropdown list since it lacks of aria attributes and states

Collapse
 
briankephart profile image
Brian Kephart

Yes, I intentionally left aria attributes off to keep the examples readable (hence my warning at the end). Can you elaborate on what you mean about states, though?

Thread Thread
 
equinusocio profile image
Mattia Astorino

Ui component states should be defined with aria attributes.

developer.mozilla.org/en-US/docs/L...

developer.mozilla.org/en-US/docs/W...

Developers should use ARIA states to indicate the state of UI widget elements and use CSS attribute selectors to alter the visual appearance based on the state changes (rather than using script to change a class name on the element).