-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add beforeopen
, afteropen
, beforeclosed
, and afterclosed
events?
#8386
Comments
General thoughts: The main question is how this integrates with the existing events that exist for these controls: I'm also a bit unsure on the use case for such events on Finally, it's worth looking at whether you need distinct events for opening and closing, or if a single event plus consulting |
Strawperson proposal:
This would be intended to be used on anything supporting
|
Am I understanding that the proposal is to add a sync mutation event ( |
No, because those are triggered by attribute changes, they should be async. I said that for |
Hmm, OK. Can you state more about the use cases for these? For example:
|
This feels uber-confusing when the trigger for the event is that a popover is going to be shown. That event, for popover at least, is a) cancelable, and b) synchronous before the element is shown. Using
The intention of two was for one to be "before" and one "after". However, in writing out the behavior for the existing elements, it looks like perhaps the only place where that makes any sense is for Popover, where there even is the concept of "before" and "after" in a clean way.
The concept and examples I can think of are all Popover-related. For example, in the "hidden"->"show" transition, before the transition, use Generally, I'm beginning to get the feeling that we might want to just go back to |
We settled on |
The CSSWG recently resolved to add
:open
and:closed
pseudo classes. These will apply to anything that can open/close, which includes<dialog>
,<details>
, and<select>
, and also the pop-up API (see DOM and html PRs). For the pop-up API, there is a need for events that fire when these states change. In OpenUI, we recently discussed the naming for these events, and resolved that we'd prefer to make this a more general set of events that should apply to anything that can be "open"/"closed".For the pop-up API, there is only the need for events that happen before the state changes, and interestingly only the "opening" event is cancelable. However, in the general case, it would seem that we should add four events, two for before/after the state changes to "open" and two for "closed".
Thoughts? Are there precedents, suggestions, or requirements for the naming of these four events?
The text was updated successfully, but these errors were encountered: