-
Notifications
You must be signed in to change notification settings - Fork 218
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
[Popup] popup vs dialog #442
Comments
Thanks for filing this issue and apologies that it's taking some time working through the list! All of the components you specified would be a good fit for As for the difference between All that being said, your point that multiple coachmarks might be shown at once is a good one. I think that experience could be designed such that only one coachmark is shown at a time, but it's true that some experiences are not designed that way today. |
Regarding tooltips being their own element limited to only text, we basically already have that with the |
@Yay295 yeah, I don't want to be overly prescriptive about the solution for tooltip (hence my slight hand-waving i.e. "own purpose-built solution/element" 😅). CSS seems like the natural tool for styling |
No problem, I probably shouldn't have made such a long issue ;) tooltip componentSounds like a great idea to make a distinct component for this 👍 popup vs dialogGood to know that all examples above (except for tooltip) can be built with the popup. For some experiences (especially on mobile) a backdrop might come in handy still (like in this example: #445 (comment)). default roleMakes sense to stick to semantics and separate presentation from it. mutual exclusivenessSounds like a sensible UX default to make popups mutually exclusive (for coach marks a different solution could be found). Would it still be possible (this is more a design concern) to have multiple popups fading in/out simultaneously? |
@Yay295 |
Thanks again for filing this, @tlouisse! Closing out this issue, but if there's anything that feels like it's still an open issue please feel free to file one on https://github.com/WICG/open-ui/issues, where we are incubating the |
Hi,
My colleagues (@daKmoR, @erikkroes) pointed me to the spec proposal for the popup element.
Being an author contributing to an overlay system of a white label component library myself, I think it's a great proposal. It could simplify our code and make it more performant.
The goals stated in your introduction perfectly align with our library goals to have an accessible, functional layer of components that can be used as the fundament for any Design System.
I have a few questions though, about the difference between popups and dialogs.
Sorry for the long text, thanks in advance for reading :)
popup vs dialog
As you mention, you considered making the
<popup>
an extension of the<dialog>
, but this wasnot pursued, because it would result in a mashed up api.
Could you elaborate on how apis would clash?
For me, from the spec, it's not completely clear what is the 'cutoff point' between a
<dialog>
and<popup>
.Roughly speaking, my impression is that a
<dialog>
would be used for elements positioned relative to the viewport and a<popup>
relative to the anchor/invoker.Maybe this assumption is not correct, let me know if that is the case :)
For me the line between the two would be blurry when looking at the variety of overlay ui components built in practice by different Design Systems.
So in that regard extending/adjusting the dialog (especially when looking at its w3c definition) with more features would make more sense to me.
Differences
In the spec you mention the following differences between
<dialog>
and<popup>
:What would be the 'cutoff point' for lightweight ui? What category would the google-apps menu fit in for instance (it's positioned relative to its anchore/invoker and has quite some content)?
What about the content of a toast or alertdialog (which is usally lightweight content)?
It seems that a
<dialog>
invoked viashowModal()
will be dismissed when pressing escape.See: https://jsfiddle.net/d6k0xp92/6/
What is the rationale behind this?
If I look at different Design Systems I worked on in the past, it was possible to have tooltips
(or maybe they were actually more like toggle tips).
that have no 'light dismiss' behavior (they would only hide when the invoker was pressed, but not on
outside click/blur).
What is the exact reasoning behind having one popup visible at a time?
Another likely scenario would be to have popups that hide with a delay (or fade out) after they lose focus
(usually on hover). This could be kind of a must inside flyout menus for user friendliness.
In such cases, when the next popup is hovered/activated, two could need be displayed simultaneuosly (when the previous one needs to fade out).
I could imagine showing multiple coachmarks
on a page could also be a use case.
How does a
<popup>
exactly differ from a non modal<dialog>
(invoked viashow()
)?Which components would be considered popups ?
If we build overlays with the current platform toolset (aria roles), I would consider the following components
popups:
All of the components above can also be implemented like this (wrapped in [role=dialog])
when a 'surrounding UI' is needed:
Would the
<popup>
fit in all situations above? Or would I need a dialog for the last example when there would be more 'surrounding ui'?I read a custom tooltip would not fit as a popup. Why exactly? (When consulting the w3c specs, a tooltip has its own role and other overlays have role 'dialog' (or listbox/grid/tree/menu when the 'root' of the overlay fits that role))
Switching context based on viewport
For many Design Systems it's common to have an overlay behaving like a
<dialog>
on mobile(or below a certain screen size) and a
<popup>
on desktop.Take for instance the datepicker...
it could behave like a dropdown/popover on desktop (see link), but on mobile an Android / iOS like
experience is required: usually a bottom sheet or modal dialog centered in the viewport (also think of behavior of a
<select>
on mobile).Of course it would be possible to make a switch in code between a
<dialog>
and<popup>
component,but, especially when used in conjunction with content projection, this would not be ideal as dom nodes
need to be moved around:
The text was updated successfully, but these errors were encountered: