Context: http://updates.html5rocks.com/2013/09/dialog-element-Modals-made-easy
show
andclose
are not opposites. It should beopen, close
orshow, hide
.open close
is the obvious winner.- There is no declarative api, which is actually really simple:
<button controls="my-dialog">
Toggle Dialog
</button>
<dialog id="my-dialog" open>
Hello
<button controls="my-dialog">close</button>
</dialog>
Using controls
to mimic WAI ARIA aria-controls
attribute. Could also use for
.
The
<dialog>
implementation in Chrome tries to follow the spec.The show/close naming is being discussed on the WHATWG mailing list, with the main thread at the end of:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-September/040897.html
So far, the names remain as they are.
As pointed out on IRC and Twitter,
<form method="dialog">
exists in the spec (but it's not yet implemented in Chrome). But there is no declarative way for an open button.Providing feedback to the WHATWG mailing list or other channels can be a good way to influence changes to the spec.