-
Notifications
You must be signed in to change notification settings - Fork 191
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
[selectmenu] Arbitrary content in <listbox> element #458
Comments
seems like defining the level of arbitrary content would be necessary? If these new element proposals are also supposed to be accessible by default, then being completely permissive with allowed content makes that incredibly hard. If there are expected types of elements or sub-components that can be slotted in, then it that sounds like it could meet the needs of what people probably want? For clarity though, is it an expectation that a But, trying to brainstorm here a bit.... under the assumption that it's options that should allow for more types of content as their children, is a potential solution to allow a And to meet the needs of a far more customizable component, could the There's a lot of potential details that i'm leaving out here... but i've already likely written too much. :) |
Ideally we'd like to have both. We know that developers want to be able to put things like images inside
I think it's important to allow at least some non-option content that is visible to accessibility in order to build things like headers between sets of related options. Even the old Patrick's Color Select demo goes further in showing how it can be useful to divide options into separate groups: I think it would be disappointing if developers couldn't have groups of options that could be separated with styled section headers like this. Although this demo has more than just the section headers -- the "More colors" button would presumably open some other dialog. It seems useful to be able to build this sort of thing, but does this fall outside the purview of |
@dandclark for the we don't want the grouping labels to be directly accessible, but we essentially want a mechanism in place that would behave similarly to a <listbox ...>
<optiongroup>
<oglegend>put your group label and some other non-interactive content here</oglegend>
<!-- options -->
</optiongroup>
</listbox> per the more colors 'button' - arguably that could very well still be an though, as i've mentioned before, this color picker example is definitely pushing the limits of what would be expected here, and not just what's rendered as the listbox content, but the fact that the invoking control is more akin to a splitbutton type control than combobox. (note: that the element that invokes the popup has no accessible name, nor do any of the color options). So yes. I think we can and should figure out ways to make UI like this easy to create and accessible. But right now, this particular demo is not accessible, so let's keep talking about how to make it so. |
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label. |
During an earlier meeting we discussed multi-select for
<selectmenu>
, and ended up resolving that we should work on specifying a<listbox>
element to use for<selectmenu>
's listbox popup.I want to clarify whether this is going to conflict with one of our early requirements for
<selectmenu>
, which is that authors can fully customize the contents of a select.We had clear feedback that one of the main things keeping developers from using the browser's native controls is the lack of control over their content, including the ability to add arbitrary markup. So (speaking for the Edge web platform team here) we would not have a lot of interest in implementing a
<selectmenu>
that fails to meet this requirement.Thus if we're using a new
<listbox>
element for the<selectmenu>
's dropdown,<listbox>
would need to allow arbitrary HTML content.There is a tension here with the
<listbox>
's default ARIA role. Thelistbox
role expects that all of its children have theoption
role, but if developers can include arbitrary content in the listbox then this will not necessarily be the case.I think this is OK. For most use cases of
<selectmenu>
, the defaultlistbox
aria role will be appropriate for its<listbox>
. If a developer builds something more outlandish -- for example a<selectmenu>
whose dropdown contains other controls -- then it is the developer's responsibility to specify an appropriate ARIA role.This will be better than the current state of things where listboxes and select dropdowns are built "by hand" out of
<div>
s where accessibility is completely dependent on the developer even for very simple re-implementations of these controls.So, is it OK for the
<listbox>
to allow arbitrary HTML content? It seems that it must do so in order to support our goal of allowing authors to specify arbitrary HTML for<selectmenu>
.The text was updated successfully, but these errors were encountered: