In Choices Single Select and Multi-select inputs, after selecting an option, it adds it to a "Selected" container with role="listbox". The option gets added as a <div role="option"> with a Remove Item <button /> inside the div.
This is an accessibility issue, because elements with role="option" cannot contain other elements, especially not actionable elements like buttons. button is not an allowed descendant of an element with role="listbox" or role="option". This confuses the assistive technologies.
See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Referenc... for more information
Found on any choices select input
I would propose that upon selecting an option, instead of creating a <div role="option">, create a regular <ul><li>. You can add the Remove Item button to each <li>. There's no reason for the list of selected items to be a listbox, right? The original choices list (choices__list) is still present and hidden.
I'm curious to get your take on whether that breaks something else which was relying on those selected items to have that role of listbox or option.
Active
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.