Skip to content
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

details element toggle event should bubble #8220

Closed
gibson042 opened this issue Aug 24, 2022 · 3 comments
Closed

details element toggle event should bubble #8220

gibson042 opened this issue Aug 24, 2022 · 3 comments

Comments

@gibson042
Copy link
Contributor

https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element

Whenever the open attribute is added to or removed from a details element, the user agent must queue an element task on the DOM manipulation task source given then details element that runs the following steps, which are known as the details notification task steps, for this details element:

  1. Fire an event named toggle at the details element.

Because that does not include "with the bubbles attribute initialized to true", the event does not bubble. And because it does not bubble, there is no convenient way to detect when a descendant details element is opened or closed (even though it is possible with general DOM mutation observation). In addition to making certain patterns unnecessarily difficult, this behavior diverges from similar events such as changing an input, select, or textarea element or its selection, resetting or submitting a form, and even clicking any element.

@smaug----
Copy link
Collaborator

there is no convenient way to detect when a descendant details element is opened or closed

Use capturing event listener?

@gibson042
Copy link
Contributor Author

gibson042 commented Aug 25, 2022

That works, but also fails the convenience criterion in many cases because the outside-in traversal order is backwards from defaults (and again, is not necessary for other similar events).

@nt1m
Copy link
Member

nt1m commented Feb 21, 2023

@domenic @annevk Is this a wontfix given #8888 ?

@domenic domenic closed this as completed Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants