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
dispatch toggleevents for dialog open/close #10091
base: main
Are you sure you want to change the base?
dispatch toggleevents for dialog open/close #10091
Conversation
I think this needs the "toggle task tracker" concept used in details elements in order to coalesce async toggle events: https://html.spec.whatwg.org/multipage/interactive-elements.html#queue-a-details-toggle-event-task If you do this and open+close the dialog element synchronously , there should be one "toggle" event with both oldState and newState set to "closed": dialog.showModal();
dialog.close(); |
Consider chrome as tentatively interested. I will file an intent to ship to get an official position when this gets a bit more attention from the other browsers, but I don't anticipate objections |
Also Gecko is interested assuming the pr follows what was discussed at TPAC. |
Tests can be added to the OP: web-platform-tests/wpt#44208 |
Hi, this implementation could help us improve a popup, such as a CMP, for better integration by utilizing native browser APIs, specifically the Popover API, to make everything more robust. This will enable us to further improve the INP impact, as described in my case study here: https://web.dev/case-studies/pubconsent-inp?hl=en. Since the CMP is a predominant component on the web, I believe this kind of implementation should be supported as much as possible. I hope it helps. Thank you |
This attempts to fix #9733 by specifying that:
show()
steps should dispatch abeforetoggle
cancellable eventtoggle
event.showModal()
steps should dispatch abeforetoggle
cancellable eventtoggle
event.close the dialog
steps should disaptch a non-cancellablebeforetoggle
eventtoggle
event.(See WHATWG Working Mode: Changes for more details.)
/interactive-elements.html ( diff )