Closed mfreed7 closed 2 years ago
I think the difficult thing we'll get into when proposing different flavors is that only some of them are consistently directly related to "popup". So elements like <dialog>
and <tooltip>
would both benefit from popup and have semantic meaning, but not every <listbox>
is a <popup>
. You could compose the select's listbox using popup, but a listbox element could also just render as a block level element in my application and not need any of that popup code. My understanding of <popup>
has been that by default it is primarily functional and behavioral to enable it being used across a variety of scenarios with different semantics. While I think popup can enable those scenarios functionally, I'm not sure that requiring it to have semantic meaning by default is the best course of action. Totally up for discussion and a good thing to officially resolve, but I think if we add semantics to popup by default we're may end up needing to add additional requirements that could make it harder to reuse across a broader spectrum of elements.
I think the difficult thing we'll get into when proposing different flavors is that only some of them are consistently directly related to "popup". So elements like
<dialog>
and<tooltip>
would both benefit from popup and have semantic meaning, but not every<listbox>
is a<popup>
. You could compose the select's listbox using popup, but a listbox element could also just render as a block level element in my application and not need any of that popup code. My understanding of<popup>
has been that by default it is primarily functional and behavioral to enable it being used across a variety of scenarios with different semantics. While I think popup can enable those scenarios functionally, I'm not sure that requiring it to have semantic meaning by default is the best course of action. Totally up for discussion and a good thing to officially resolve, but I think if we add semantics to popup by default we're may end up needing to add additional requirements that could make it harder to reuse across a broader spectrum of elements.
Thanks for the comment. This was my take also - we're adding a functional component called <popup>
that can be used to build several different kinds of UI. Kind of like <dialog>
really. As such, the element itself has less specific semantic meaning. I do think that the idea has always been to keep going with new elements, e.g. <tooltip>
, and those might use a <popup>
for functionality. Or <selectmenu>
's listbox, as you mentioned. But those will be the elements/uses that have more direct semantic meaning. And <popup>
can represent the more generic concept of a "thing that pops up", which I guess is role=dialog
with aria-modal=false
.
By the way, this issue relates directly to https://github.com/openui/open-ui/issues/329.
Role=dialog with aria-modal=false is the dialog element, so if that's the desired semantic this proposal should be morphed into an update or extension of the dialog element.
I disagree strongly with the idea that dialog is a "functional component", or that such a concept is even something the HTML language contains. HTML elements provide specific semantics; if you're using them to express functionality divorced from semantics, then HTML is not the right language to implement the API in.
Role=dialog with aria-modal=false is the dialog element, so if that's the desired semantic this proposal should be morphed into an update or extension of the dialog element.
To be clear here, the desired semantic is none for popup. The intent of the element is functional; it could be used to build semantic elements such as the positioning, focus delegation, etc of dialog, but we are looking at usage well beyond dialog and with quite varying semantics (listbox of select menu).
Yeah, as I said in my edit, "the desired semantic is functional" is a contradiction in terms. It sounds like maybe this API is best done through JavaScript, not HTML---e.g. some JS function that lets you give an arbitrary element light dismiss behavior, or put it in the top layer. Then the semantics can be provided by HTML, and the functionality is done through JavaScript, in congruence with web platform design principles.
Yeah, as I said in my edit, "the desired semantic is functional" is a contradiction in terms. It sounds like maybe this API is best done through JavaScript, not HTML---e.g. some JS function that lets you give an arbitrary element light dismiss behavior, or put it in the top layer. Then the semantics can be provided by HTML, and the functionality is done through JavaScript, in congruence with web platform design principles.
Just to be clear, I denoted “none” rather than functional as the desired semantics. I get your point, but it is an important difference IMO and I’d be curious how “none” is a contradiction as far as implicit role, etc. Is the bar for any new element an applied semantic that maps to ARIA? I’ll let others chime in here, but if the ask is to revisit this as a JavaScript API then it would be great to see that presented as an alternative. Much of this seems to exist in the platform already at some level (putting elements in the top layer), but isn’t exposed to authors. The intent of the element is to allow authors to compose UI without necessarily requiring JS. It seems reasonable to have that as an ask, but I’m certainly open to hearing why that’s not a feasible approach.
@domenic as a quick follow-up, I just was reading up more through your responses in the linked issue. You mention:
No, this isn't correct. The dialog element can only be used for dialogs. Tooltips or toasts should be done using
s or similar. (Or perhaps a new element, if someone were bold enough to propose one... I seem to recall something of that sort for toasts.) If you use
I’d be curious how “none” is a contradiction as far as implicit role, etc.
Sure. We already have two elements with "none" semantics: div and span. If people want to create elements with none semantics, then they should use div and span. Otherwise, new HTML elements should have new semantics.
Is the bar for any new element an applied semantic that maps to ARIA?
That's a good first approximation, IMO, but I wouldn't call it a hard-and-fast rule. In particular ARIA is mainly focused on roles that give different assistive-tech behavior, and "different semantics" are not 1:1 with "different AT behavior". For example, the <link>
element has no ARIA role, but it has pretty clear semantics (linking to, or importing, an external resource). Similarly <input type=date>
, <em>
, or <br>
.
Rather the relationship to ARIA I would promote is the one I alluded to in https://github.com/w3ctag/design-reviews/issues/680#issuecomment-941533235, i.e. an implication of "the first rule of ARIA": we should never introduce a new HTML element which requires ARIA to function. So in particular, we should never introduce a new HTML element which we expect to, as a matter of course instead of as a special exception, be used with ARIA.
but if the ask is to revisit this as a JavaScript API then it would be great to see that presented as an alternative
I agree it would be great to see; that's why I brought up this issue, because we need the proposal proposal authors to investigate other ways of achieving the same goals that are congruent with the web platform design principles.
The intent of the element is to allow authors to compose UI without necessarily requiring JS. It seems reasonable to have that as an ask, but I’m certainly open to hearing why that’s not a feasible approach.
It's not feasible because, aside from div and span, HTML elements are a fundamentally about semantics, not behavior. You define a semantic for an element, and then derive behaviors that support that semantic.
If the goal of a proposal is to bring new behaviors, but no new semantics, then JS is the right manifestation for exposing them, not HTML.
(Ideally, those behaviors are done in a "layered" way (cf https://extensiblewebmanifesto.org/), so that JS already has access to these and the semantic elements just bundle them together into a declarative package with the right semantics. In the past that hasn't happened all that well; e.g., <details>
was defined before the foundational layers (such as shadow DOM) were, and <dialog>
is still defined without any other way of accessing the top layer (leading to the abuses of it that @mfreed7 mentions in https://github.com/w3ctag/design-reviews/issues/680#issuecomment-943658117). I don't think this kind of strict layering is required for all new elements, but it sure makes things nicer for authors in my experience.)
I think the trouble I’m having is that if the only way to standardize this behavior is through new elements for each, that’s going to be difficult, especially for scenarios like the listbox in select, or a context menu, where we want the functionality of the popup but as you call out, the semantics AND focus management are quite different from dialogs, tooltip, etc.
Yes, I think doing the right thing is hard :). But it's better than trying to ship popup, and over-claiming its applicability out of the box as something that works for menus, listboxes, tooltips, teaching UIs, content pickers, and form element suggestions. If in fact popup doesn't supply enough for those, but is only a building block, then I'd see two good paths:
<div role="tooltip">
or <div role="menu">
while admitting that we haven't yet done the work to create full elements that embody the desired semantics and behaviors for tooltips/menus/etc.Thanks for the follow-up @domenic. Given this feedback @mfreed7, @gregwhitworth, @melanierichards we should probably prioritize this discussion at our next telecon.
I think many would like and prefer elements so that both the behavior AND semantics are available to web authors without having to include their own JS. I think that's the long-term ideal. With that said, my own selfish "immediate" needs and wants are the low-level JS API's. Some exist in some capacity already for the platform, but are not available to web authors. If I had to choose between the two today, I would take the JS API's as they'll better enable our building of custom elements with behavior we don't currently have access to today. If we had to "crawl, walk run" here, I'd personally prefer prioritizing the low-level API's and then leverage and reference those as part of specific custom-element proposals.
Can such 👆 low level APIs integrate within built-in elements? Should such "interior" component be exposed to web authors? As mentioned, it doesn't have a semantic meaning on its own
So I understand the desire to "decompose" the current <popup>
element proposal into lower-level APIs. And if that's possible, I can see the value in doing so. It would make it more straightforward to explain several new (potentially more-specific/semantic) HTML elements in terms of those APIs.
I'm curious about why this would be a Javascript API, though. It would seem more like a CSS primitive to me, since it deals with presentation: being on the top layer. Looking at the three functionalities provided in the original <popup>
feature:
popup {
position: top-layer;
}
popup {
light-dismiss: [none | esc | click-outside | scroll | other-top-layer-element | all]+
}
light-dismiss
. If the other-top-layer-element
value is provided for light-dismiss
, then that element is "one-at-a-time". If not, then multiple of them can exist simultaneously in the top layer. That feels a bit magical, since at least for <popup>
, there is a stack of popups, created by examining their anchor
attributes and/or other elements' popup
attributes, and thus allowing multiple nested popups. I don't know how to achieve that in a standalone API. Suggestions welcome.Oh, sure, CSS is also reasonable; sorry for forgetting that option.
Good point @mfreed7 - I do like the idea of keeping those in the presentation layer. I know a couple additional things which were discussed as well were transitions/animations and focus management. For animations, I think the web animations API would provide the needed support there already. For focus management we do have a proposal out for focusgroup which was already being discussed in coordination w/ <popup>
. Regardless of where that ends up, I think the primary point is that the right low-level API's can make creating things which popup much easier on web authors.
Subjectively, I like the idea of exposing the top-layer and light-dismiss behavior via CSS more so than JS. It feels intuitive and I think there is value for not requiring JS to achieve these specific functionalities.
RE: Your question on light dismiss above - my initial reaction is to lean into allowing things at the top layer which do not light dismiss. I'd agree that it's a vector for abuse, but there are existing (and I think legitimate) patterns where a user is asked to make a choice or declaration in order to proceed into the main portion of the UI. I definitely want to be conscious of the ways folks might misuse this, but it seems like a miss if we require light-dismiss for anything in the top layer.
Good point @mfreed7 - I do like the idea of keeping those in the presentation layer. I know a couple additional things which were discussed as well were transitions/animations and focus management. For animations, I think the web animations API would provide the needed support there already. For focus management we do have a proposal out for focusgroup which was already being discussed in coordination w/
<popup>
. Regardless of where that ends up, I think the primary point is that the right low-level API's can make creating things which popup much easier on web authors.
Good points - animations and focus need attention here also. For animations, while the Web Animations API can support animation use cases, it'd also be nice to support them with "plain" CSS also, without requiring JS. Perhaps a pseudo-class for being in the top layer?
popup {
opacity: 0;
transform: translateY(50px);
transition: all 1s;
}
popup:top-layer {
opacity: 1;
transform: translateY(0);
}
The only thing missing here is that <popup>
is made display:none !important
when it is hidden. Perhaps if we just relax that to display:none
(without the !important
), then developer CSS can manage the entire show/hide lifecycle if they'd like? This might also obviate the need for beforeshow
and show
events to manage animations. But maybe I'm not thinking this through.
For focus management, there is already a discussion about expanding the delegatesfocus
(name change TBD) attribute and behavior to other elements. And as you point out, the focusgroup
attribute might be applicable here also? But beyond that API, perhaps the particulars of focus management are unique to each element? For the proposed <popup>
element, the focus behaviors are:
<popup>
does not change the focus.<popup>
has the delegatesfocus
attribute, focus the first focusable descendent of the <popup>
.<popup>
or a descendent has the autofocus
attribute, focus that element.<popup>
.<dialog>
, focus is returned to the previously-focused element when the popup is hidden.From the above, it seems like delegatesfocus
is the only required new low-level primitive. But am I missing something?
Subjectively, I like the idea of exposing the top-layer and light-dismiss behavior via CSS more so than JS. It feels intuitive and I think there is value for not requiring JS to achieve these specific functionalities.
I'm glad. And it sounds like @domenic agrees. I would very much like to enable as much of this proposal without requiring Javascript.
RE: Your question on light dismiss above - my initial reaction is to lean into allowing things at the top layer which do not light dismiss. I'd agree that it's a vector for abuse, but there are existing (and I think legitimate) patterns where a user is asked to make a choice or declaration in order to proceed into the main portion of the UI. I definitely want to be conscious of the ways folks might misuse this, but it seems like a miss if we require light-dismiss for anything in the top layer.
I think I agree. The tricky thing will be specifying the rules by which the various participants in the top layer work together. For example, a full screen element likely should always remove other elements from the top layer. Similarly for a modal <dialog>
. We just need to be careful about the interactions, and also make sure to specify this feature so that the UA is still in charge of the top layer, and can do the right thing when there is contention.
Moving these capabilities into CSS (and HTML attributes where we’ve already said they could be extended to other elements) is an interesting line of thought. I’m considering what we might lose in the process, just for completeness:
popup
content attribute, which enables another element to show the popup and establishes a controller / haspopup semantic relationship.autofocus
behaviors when a popup is shown.<selectmenu>
. Is the part
attr enough for controller code to wire up the proper listbox semantics for that? Do we want to propose a <listbox>
element?Apologies if I’ve misinterpreted anything, reviewing this thread while brain-tired.
Also wanted to +1 on top-layer mgmt being more tricky if we go this route.
I would love to see some of these capabilities exposed through CSS. We have a "building block" popup custom element that is conceptually very similar to the current proposal here - it has no semantics of its own and is used as part of tooltips, etc. But while powerful, it has always felt hacky because it's almost entirely concerned with presentation and most of its "API" is in CSS.
Although this element ended up successful for us, we always have to choose between enabling a RAF loop or not to keep the position correct depending on the trade off between the cost of the loop (which triggers layout) and the likelihood that the positioning requirements / other dependent CSS may change dynamically:
To me it seems like this strongly hints that the layout concerns in question more properly "belong" to CSS. We use a custom element for it right now only because of the current need for JS to achieve these positioning behaviors.
I'll include one last snippet from those docs for more context: they begin with our working definition of "popup" from initial design research. This may be useful for comparison to get a sense for the extent to which our element is or isn't similar to what's being proposed here since if they're more different than I realize, maybe the potential for CSSification is more limited than I'd hoped. Ours doesn't, for example, handle the "light dismiss" stuff - we leave that to the other elements that consume it since the particulars vary between usages.
The Open UI Community Group just discussed https://github.com/openui/open-ui/issues/410
.
The minutes above seem to have missed the whole discussion, but this one looks complete:
Per the meeting just now, I'm going to open a fresh issue (soon) for the question of whether/how to break apart the primitives of <popup>
into separate low-level things. In the meantime, let's re-focus this issue on the OP - what does a <popup>
mean, semantically?
Reading the minutes, I feel like some people pushing for "a generic semantic" were missing the points I made. Which is, if you want a generic semantic and not one of the existing semantics like listbox, dialog, tooltip, or menu, then the <popup>
element must not be used for any of those purposes. Conversely, if you want an element that can be used for listboxes, dialogs, tooltips, or menus, then it must be usable for exactly one of those roles, not multiple. (Or, it can have some kind of switching like type=""
, but as mentioned in the TAG review that has not worked well in the past.)
I hope this helps people advocating for a generic semantic to better understand the issue in question.
The Open UI Community Group just discussed semantics for popup
.
Reading the minutes, I feel like some people pushing for "a generic semantic" were missing the points I made. Which is, if you want a generic semantic and not one of the existing semantics like listbox, dialog, tooltip, or menu, then the
<popup>
element must not be used for any of those purposes.
Thanks @domenic. I'm hoping you can clarify something for me. I'm not sure if there are strict definitions for "a generic semantic" and "non-semantic", but if those are interchangeable (and they seem like they are being used that way), then your logic above would say you're not allowed to use a <div>
or a <span>
to create those things either.
The general consensus at the meeting was that there is still a (strong?) desire to have a <popup>
element which can be used for multiple purposes. It's like "a <div>
with functionality" - that was said several times. Is there not a place for such a thing in the platform? I know you mentioned <details>
as a bad example from the past, but it seems to be useful. What's the right way to go about a non-semantic element with functionality?
Having said all of that, I also don't exactly think <popup>
is strictly non-semantic. Subject to lots of bikeshedding:
a
<popup>
is a lightweight, ephemeral piece of UI content that is displayed on top of page content.
Does that suffice for the semantic definition of <popup>
?
What do folks think of these existing HTML elements?
<article>
: "Examples include: a forum post, a magazine or newspaper article, or a blog entry, a product card, a user-submitted comment, an interactive widget or gadget, or any other independent item of content."<nav>
: "Common examples of navigation sections are menus, tables of contents, and indexes."<input>
: Clearly an old and oft-complained example, but it can semantically represent all kinds of things.<dialog>
: "represents a dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow."All of these, at least according to MDN, seem like "generic semantics" that can be used to represent a class of things. Some of those things above (e.g. <nav>
) have sub-class elements (e.g. <menu>
).
then your logic above would say you're not allowed to use a
<div>
or a<span>
to create those things either.
No. As I mentioned in https://github.com/openui/open-ui/issues/410#issuecomment-944359957, it's precisely because we have div or span already to fill the role of non-semantic, needs-ARIA-to-work, that we can't create new elements in that space.
Is there not a place for such a thing in the platform?
There is not. The space of non-semantic elements which get semantics layered on top of them manually is taken up by div and span. Adding new ones breaks the first rule of ARIA and encourages people to create more "div soup" (just, in this case, "popup soup").
I know you mentioned
<details>
as a bad example from the past, but it seems to be useful.
Details has semantics. I mentioned it being a bad example of adding something without adding primitives. That badness is orthogonal to the semantic question.
What do folks think of these existing HTML elements?
These all have well-defined semantics. You can most easily see this by the ARIA mapping they have: article maps to role=article, nav maps to role=navigation, input has complicated mappings based on its attributes (e.g. role=checkbox, etc.), and dialog has role=dialog.
As I mentioned in https://github.com/openui/open-ui/issues/410#issuecomment-944359957, it's not a requirement that every element have an ARIA mapping to have reasonable semantics. But, as I said there:
we should never introduce a new HTML element which requires ARIA to function. So in particular, we should never introduce a new HTML element which we expect to, as a matter of course instead of as a special exception, be used with ARIA.
This is another way of phrasing what I said in https://github.com/openui/open-ui/issues/410#issuecomment-948920137, which is
Which is, if you want a generic semantic and not one of the existing semantics like listbox, dialog, tooltip, or menu, then the
<popup>
element must not be used for any of those purposes.
then your logic above would say you're not allowed to use a
or a to create those things either.No. As I mentioned in #410 (comment), it's precisely because we have div or span already to fill the role of non-semantic, needs-ARIA-to-work, that we can't create new elements in that space.
Is there not a place for such a thing in the platform?
There is not. The space of non-semantic elements which get semantics layered on top of them manually is taken up by div and span. Adding new ones breaks the first rule of ARIA and encourages people to create more "div soup" (just, in this case, "popup soup").
To me, what could distinguish something like
<popup>
from<div>
/<span>
is that it could have things layered on top by the browser, automatically rather than manually through author-added ARIA. Things like ”this goes on top of other things / everything else”, focus management and setting the right ARIA properties could all break if authored on adiv
incorrectly or incompletely. It would benefit end users if such things can somehow be “built in”… my hope is that with its own element, such things could be implemented more robustly (by browsers).As the popup research showed a variety of use cases, I agree such an element would need something to declaratively switch between types so that each type can have appropriate ARIA, focus management etc (as you and others say in https://github.com/w3ctag/design-reviews/issues/680).
Yep, that sounds about right. With the slight modification to your last sentence,
I agree such an element would need something to declaratively switch between types so that each type can have appropriate ARIA, focus management etc (as you and others say in w3ctag/design-reviews#680).
that in the past we've found this kind of dynamic switching to go pretty poorly (i.e., the point the TAG made about how <input>
's type=""
is not great design), so instead I'd suggest multiple distinct elements.
To summarize the options on the table:
<popup>
element that can be further semantically enhanced by ARIA or by controller code when used in contexts like a customizable <selectmenu>
.type
attribute to <popup>
to modify semantics (role).<popup>
element.<popup>
<dialog>
to make it behave like a generic <popup>
.The landscape as I see it (and have heard agreement on it) is this: there is a base class of various concepts that we would call a "popup". These concepts share particular behaviors, e.g. top layer rendering, transience and light dismiss behaviors, mutual exclusivity (unless nested), etc.
Some of the sub classes of "popup" have stronger, more specific semantics:
role="listbox"
role="menu"
Other popups share these strong behaviors, but do not have particularly strong semantics. These would be roughly equivalent to role="dialog"
. Users should be aware that they are interacting with a temporal pane/dialog, but accessibility APIs might not have a more specific concept to map to:
In either case, content attributes can handle semantic relationships similar to aria-haspopup
or aria-controls
. Focusing here on the semantics/role of the thing itself.
What I would like to propose is that we:
<popup>
element for all the rest which don't have strong semantics, OR provide an attribute that could be added to <dialog>
to make it behave like a <popup>
.Side note: we may want to consider an element for navigational menus, as authors would be likely to reach for a new menu element for these, and that would confer semantics that are inappropriate to nav menus.
Please note that I have not listed tooltip
anywhere in this proposal. Tooltips have a specific behavioral set and content model expectations that make them distinct from popups, and we should explore "a customizable tooltip on the web platform" separately from this discussion.
The Open UI Community Group just discussed Should there a `<popup>` element and what would be its semantic role?
.
Create new elements for subclasses of popups that have strong semantics. We could also consider additional elements for subclasses of popups that may have very distinct behaviors and would warrant a separate carveout (I do not have candidates in mind for this but worth mentioning).
This makes sense to me, although I don't understand the distinctions you're making between "strong semantics" and "very distinct behaviors". But +1 to the general idea of building semantic elements with their own custom behaviors.
So far it sounds like you have listbox and menus; I know those behave differently in terms of focus (listbox = focus first element, menu = focus the menu), and probably other things as well.
Either provide a generic
<popup>
element for all the rest which don't have strong semantics, OR provide an attribute that could be added to<dialog>
to make it behave like a<popup>
.
Based on my reading of the "Other popups share these strong behaviors, but do not have particularly strong semantics" examples, it seems like a dialog extension. E.g. the ARIA best practices document lists date/time popup pickers as using the dialog role and dialog's focus-the-first-focusable-element focus behavior (direct link), but also shows light dismiss behavior. So e.g. <dialog lightdismiss>
or <dialog>.show({ lightDismiss: true })
might be good ways of implementing that.
It might be worth doing more research or consulting with accessibility teams on what the best presentation is for the other "other popup" behaviors, but I suspect non-modal dialog is the right choice in general.
Navigational menus (these are not action menus!)
Interestingly it looks like according to the ARIA folks you use the same accessibility markup for both types of menus: https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton
We could have separate semantic elements if we think the semantic and behavioral differences are important (as I assume the capitalized "NOT" indicates), e.g. <navmenu>
and <actionmenu>
. They would have the same accessibility roles and setup though it seems.
This makes sense to me, although I don't understand the distinctions you're making between "strong semantics" and "very distinct behaviors".
I don't have an example of "very distinct behaviors", just heard murmurs that some folks might want to cordon off popups that feel particularly behaviorally distinct, so want to acknowledge that possibility.
It might be worth doing more research or consulting with accessibility teams on what the best presentation is for the other "other popup" behaviors, but I suspect non-modal dialog is the right choice in general.
Agreed. In UI Automation anyway, I anticipate the Pane control type being most appropriate for many of these, which is how dialog maps into UIA. Other APIs might have a couple other options though.
Interestingly it looks like according to the ARIA folks you use the same accessibility markup for both types of menus: https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton
Currently documented as such, but there is not consensus on the appropriateness of this. UIA certainly expects menus to be an array of actions as opposed to navigational links (I'm referencing UIA here because it's the API I'm most familiar with). Anyway, this is a little in the weeds and we can take these choices one by one.
Thanks for the comments @melanierichards and @domenic.
It sounds like we have agreement that there should be separate, more specific elements (eventually) for some roles like listboxes and menus. But the big sticking point is the more general purpose element that doesn't fit into one of these more specific elements.
From this comment:
Interestingly it looks like according to the ARIA folks you use the same accessibility markup for both types of menus: https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton
We could have separate semantic elements if we think the semantic and behavioral differences are important (as I assume the capitalized "NOT" indicates), e.g.
<navmenu>
and<actionmenu>
. They would have the same accessibility roles and setup though it seems.
...it sounds like it would be ok to introduce two different elements that both map to the same accessibility role? That leaves open the possibility of having a <popup>
element that maps to the "dialog"
role (with aria-modal=false
), is that right?
This, I believe, would be beneficial as compared to something like <dialog isreallyapopup>
, because many facets of <popup>
don't apply to dialog. These include things like the anchor
attribute, which would need to be present but unused on the HTMLDialogElement
IDL. This is part of what is so painful about <input type=foo>
- the attributes list is quite convoluted.
I can't help but draw the parallel to the <section>
element. Its description says it is a "generic standalone section of a document, which doesn't have a more specific semantic element to represent it". MDN further gives the example that a navigation menu should use a <nav>
element instead, but that search results or map displays should use <section>
since they don't (yet) have an element. I would think <popup>
is similar - it provides the general case, to be used unless there's a better, more-specific element like <listbox>
or <actionmenu>
.
@domenic (and any others that want to participate), it'd be great if you could potentially join in the discussion at the next OpenUI meeting when this issue is on the agenda. We'd love to come to a consensus on the best way forward, and we need your help!
...it sounds like it would be ok to introduce two different elements that both map to the same accessibility role? That leaves open the possibility of having a
<popup>
element that maps to the "dialog" role (with aria-modal=false), is that right?
Yes, that sounds reasonable. As long as people never use it for listboxes, menus, or tooltips, and the spec makes it clear doing so is invalid!
I'd suggest a name like <popupdialog>
in that case.
Although on further thought, it'd be helpful to get a more detailed account of
many facets of
<popup>
don't apply to dialog
I.e., I think anchored non-modal dialogs are pretty common, so making anchor=""
work with <dialog>
in that way seems very reasonable to me.
In other words, I think a comprehensive pro/con comparison of <popupdialog>
vs. <dialog lightdismiss>
or similar would be a good next step. How many of the popup behaviors could work with non-modal <dialog>
? With modal <dialog>
? How much functionality would end up duplicated between <dialog>
and <popupdialog>
, if they were separate? Etc.
Thanks! It sounds like we're making progress. So here's a proposed way forward, upon which it sounds like we might be in rough agreement:
<popupdialog>
or <transientdialog>
? I can open an issue for naming. For the rest of this post, I'll use <popupdialog>
.<section>
.<listbox>
, <actionmenu>
, <tooltip>
, and <toast>
(!). Maybe also a <navmenu>
? The <listbox>
element might need to be worked out sooner, so it can be used for the <selectmenu>
proposal. If this post gets general agreement, I can open a separate issue to brainstorm the appropriate element list.<popupdialog>
.<popupdialog>
proposal to see if any parts of the proposed behavior no longer apply, or are different, in a context where some use cases, e.g. <listbox>
or <actionmenu>
, exist. For example, do we still need delegatesFocus
/autofocus
behavior? (We might, but it is worth asking.)Separately from the above points, I also totally agree with your point that we should put together a point-by-point comparison of <popupdialog>
and non-modal <dialog>
, both to point out how they are different, but also to see where there might be commonalities that can be shared between them. The explainer actually does have something of a comparison like this, but it would be good to take a fresh look.
That sounds great to me!
@mfreed7 @domenic I like the direction of separate elements for separate use cases / role
s.
They can still share some (or most, or even all) of the APIs and attributes, similarly to e.g. <audio>
and <video>
.
I've opened issues for bikeshedding a new element name, and the list of proscribed element types.
is listbox
only being considered as a popup element? apologies if i have missed this answer somewhere else. would definitely be useful as a non-popup as well.
Regarding the idea that a popupdialog
would map to a non-modal dialog... while there would be overlap there, the transient nature of it likely means we need a variation to the mapping. Something different about it to let screen reader users know "this is a dialog (<dialog>
), but this (<popupdialog>
) is a dialog that is going to disappear on you". There are already some mixed expectations for non-modal dialogs (should tab key be able to exit, or should it be trapped in the non-modal dialog and another key, F6 for instance, be used to cycle between open dialogs / the primary document). I am not looking for an answer to that here... but I am calling it out as to why I don't think this can just be mapped to a non-modal dialog.
i very much like the idea of the separate elements approach, but it makes me still wonder what a generic popupdialog would be used for? And I say this because every time I think of something that could go in it (that isn't already called out in the excluded types issue), I then also think "well, that would be better as a 'popuplist' or a 'popuptoolbar', or a 'popupgrid'. I'm not actually making element suggestions there... just thinking aloud of where is the line?
I then also wonder if there are certain types of components that a popupdialog
should not be used for, then there would also need to be a list of elements (and roles) that would not be allowed as descendants of popupdialog
as well. e.g., if it can't be a listbox, then i would assume <select multiple>
could not be a descendant?
The Open UI Community Group just discussed https://github.com/openui/open-ui/issues/410
.
I'm closing this.
This is a question raised by @domenic on the TAG review for the
<popup>
, here. Copying the relevant part from that comment:Should we be proposing several "flavors" of popup instead as separate elements, e.g.
<tooltip>
,<listbox>
, etc.?