-
Notifications
You must be signed in to change notification settings - Fork 216
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] using position absolute while 'escaping out of stacking context' #443
Comments
I believe we were thinking |
I agree - my understanding of the intention (and the actual implementation in Chromium) was that any positioning method should work. The As for positioning relative to other content that is not in the top layer, that's the subject of a different issue. |
Thanks, that's nice to hear 👍 Will it still be possible to 'undo' the top layer positioning as well via a css primitive, like proposed here? |
Hmm, I'm not sure which part of that thread you're referring to, but the current proposal for |
Basically I was referring to the opening post in the thread, which roughly proposes: .my-panel {
position: top-layer; /** or any other name that indicates it should be placed on top layer */
} If this proposal (or something similar) would make it, the A practical example would be configurability in different contexts.
desktopAnd on mobile, the listbox options are in the document flow (a sibling of the input, and the parent is an overlay/dialog). mobileSo on desktop the search listbox is an overlay, on mobile the the search listbox is in the document flow (it is contained in a parent overlay together with the input). Let's say the (highly simplified) code below represents this component: <github-combobox>
#shadow-root
<input role="combobox">
<popup id="listbox" role="listbox">
<div role="option"></div>
<div role="option"></div>
...
</popup>
</github-combobox>
Since it is not possible to dynamically change html tags on desktop/mobile switch and recreating a cloned sibling dom tree is something to avoid at all costs (you would need to synchronize focus and other states), I can see the need for this css primitive. Other examplesThis page shows different extensions of a lion-combobox. The popup overlay display would be a sensible default for most comboboxes. The whatsapp example however, needs to be unstyled (listbox options need to be in page flow) |
Thanks again for filing feedback, moving the discussion to openui/open-ui#326! |
A
<dialog>
will only 'escape out of its stacking context' (overflow:hidden
or transform) whenposition: fixed
is applied.Would it be possible to achieve the same when
position: absolute
is applied as well?For a popup positioned relative to an anchor/invoker, a recalculation would need to take place
on scroll/resize otherwise.
It would be nice if the top layer functionality described here could be implemented, while being able to position within the document flow.
The text was updated successfully, but these errors were encountered: