-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Showing only a child popover causes "beforetoggle" and "toggle" events but popover is invisble #9487
Comments
Hmm yeah I see that the child popover can be showing while the parent is not showing. I suppose it would make sense to disallow this for popover=auto elements where the hierarchy means something.
In order for the child popover to be showing, the parent would need to also be showing right? Or do you think we should change the rendering somehow in a way that allows the child to be visible? |
Right. That would be aligned with https://open-ui.org/components/popover.research.explainer/#nested-popovers.
Yes.
No, as long as there are no use-cases for it. |
@nt1m what's Apple's view on this? |
In order to resolve this we could add a step to check popover validity which looks for the closest popover=auto ancestor and stops popovers from being shown if their popover=auto ancestor is not showing, right? |
I'm tempted to say we don't really need to address this, it's like the case you're putting a popover inside |
That should work, although it might make "check popover validity" harder to understand and too generic. Actually seeing the change would help. Adding specific checks to https://html.spec.whatwg.org/#show-popover only could lead to a clearer structure, since that's the only function requiring such checks. |
Hard to judge without actual use cases. But since the issue is pretty easy to reproduce, it might be worth fixing. |
I don't really have a strong opinion here, but I guess the most simple solutions would be:
|
+1 for throwing an exception. |
Agreed
What exactly should we add in either place if we do this anyway? I don't think we have an algorithm already which just finds the closest popover=auto ancestor or lets us easily iterate over all the ancestors as defined by the relationships with invokers etc. |
Example: https://jsfiddle.net/ux09nbsy/1/
Tested Chrome Dev edition and Firefox, both on Ubuntu 22.04.
It's seems desirable to actually show the popup. Otherwise, which is unlikely, the spec would need to be adapted.
CC @josepharhar
The text was updated successfully, but these errors were encountered: