-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Discussion] - Goals, hurdles & opened questions #4
Comments
@VicGUTT Thanks so much! I'm going to spend a lot of today spinning this into more issues and documents, @mirisuzanne alerted me people are wanting to start helping! Thanks so much for writing this all out, is it okay to come back with any questions? |
Also cc: @keithamus, since he might have some more time to work on this! |
Thank you for setting things up!
Nice! I'll keep an eye out, provide feedback when necessary and even chip in :). Don't hesitate to ping me 👌
Oh please do :) |
First question @VicGUTT, is there a more recent spec you are referring to re: anchoring? We started this polyfill without https://github.com/oddbird/css-anchor-positioning being ready due to not thinking they were that related. |
Oh nice I somehow didn't see that repo ^^. I'm not referring to any specific spec and from what I understand the two features: pop-up & anchoring are loosely related.
Based on that sentence I figured the two polyfills would need to play nice with each other. |
We have early work in that area: https://github.com/oddbird/popup-polyfill/blob/337c69c46ff3554d86580ec5edf11b2efbcd4126/src/popup.ts#L11
zIndex might be the easiest path forward, but it does come with significant concerns as the top layer is one of the major benefits to popup (also the hardest to polyfill 😄. Moving elements in the DOM to a last-child of body avoids some issues but present others (css selectors may be invalidated, events may propagate in the wrong places).
I believe this is a working implementation: #2. The explainer document speaks only to
Generally I'd say we should use
Yes we will do. Generally speaking in the HTML spec any event triggered should call |
Hey thanks for the feedback Keith! Yes I have seen some early answers and implementations in the code to some of my open questions. I believed it'd still be useful to write them down here :).
Yeah I totally agree with your two points. It's not easy to figure out ^^.
Yeah that is true, the explainer only outlines the initial page load scenario. Find by me! And I 100% agree with your last two points. |
Using dialog would give us the backdrop, the top-layer, and autofocus support. But it presents two new problems:
|
The dialog element only renders the page inert when invoked with
According to canIUse, the dialog element has 90+% support except for the |
This is true, however a dialog shown without
While current versions of browsers all support this, the fall-off on older versions is quite steep. For example the current Firefox ESR (91) does not support dialog, and only the current major version of Safari supports it. The dialog polyfill claims to work back to IE9, so it's a viable strategy, but it does mean this polyfill would inherit all problems of the existing dialog polyfill(s). |
Started a bunch of issues I will add notes to! |
Right. And we can always go the adjacent True, and I wasn't aware of ESR versions of Firefox, although for the examples provided, older versions of Firefox & Safari combined seem to account for 1.30% total. I guess we'll need to decide what threshold of "not supported" browsers would be acceptable. Yay thanks @oluoluoxenfree :). I'll see what I can pick up ✌🏾 |
Another bummer about making use of the dialog element is that, as stated in the OpenUI Discord channel, So, a summary on making use of the Pros
Cons
|
|
Hey peeps!
After a brief discussion on the OpenUI Discord I'm opening this issue to help point out some of the hurdles we might face implementing this polyfill and highlight some of the goals.
Goals
popup
|defaultopen
)popUp
|defaultOpen
)popuptoggletarget
|popupshowtarget
|popuphidetarget
)popUpToggleTarget
|popUpShowTarget
|popUpHideTarget
)(show|hide)PopUp()
, or via the IDL Attributes:el.popUp = '...'
?)defaultopen
)<dialog>.showModal()
,<div>.requestFullscreen()
,otherPopUp.show()
, ...)show
|hide
)Hurdles to overcome
Open questions
const stack = new StackOfPopUps; stack.add(el); if (condition) stack.pop(el)
):where()
?defaultopen
attribute?querySelector
on page load &MutationObserver
for if the attribute get's added later on?show
|hide
)CustomEvent
will do? (Dialog's polyfill usesCustomEvent
)on(show|hide)
handlers? (Dialog's polyfill triggers them)The text was updated successfully, but these errors were encountered: