-
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
Consider renaming <dialog>.close() to .hide() #7748
Comments
This has been discussed many times in the past, and is not desirable. Popup should instead align with dialog. See https://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-December/041799.html and surrounding messages. A brief summary: closing the dialog is different than hiding it; in particular closing it gives it a return value and unblocks the page for other dialogs and so on. Whereas hiding it is something you can do with the
|
So if you look at the discussion at OpenUI about this, the biggest holdup was the lack of symmetry. I definitely agree. Dialog’s |
@mfreed7 but did they consider the argument brought to light above? Looking at that issue it doesn't seem like it. As Ian explains in the email, show, hide, and close are distinct things that all make sense for the element. |
So reading through the 2013 naming thread for It sounds like there isn't too much appetite to try to change I'm ok closing this issue, if you'd like. |
I'll try to add a clarification note to the spec before closing this, basically outlining the logic here. |
This has been discussed in the context of the Popup API within OpenUI, here. The general consensus there was to adopt a more "parallel" set of names for Popup,
show
andhide
. The<dialog>
API was called out for not being consistent:show
andclose
.Perhaps we should consider deprecating
<dialog>.close()
and replacing it with.hide()
? Unfortunately, Chromium doesn't have a use counter for<dialog>.close()
but I would imagine it's close to the usage of.showModal()
plus.show()
, which is around 0.025%. That's a surprisingly small percentage of the overall usage of the dialog element, which is around 4%. Perhaps most people are adding/removing theopen
attribute?The text was updated successfully, but these errors were encountered: