|
|
|
|
|
by no_wizard
443 days ago
|
|
There's some quirks with the API around open vs openModal if you aren't aware of the accessibility implications you may not even realize this is the case. Forms have some special quirks inside of a dialog. The biggest thing though, is for the life of me I don't understand why you can't open and close a dialog without JavaScript. There's no way to do it. |
|
You can use popovers like this without JavaScript:
You can mark a <dialog> element as open by default with the `open` attribute, and you can close it with a button using the `dialog` form method. No JavaScript required for that either.I don’t think there’s any way at present to open a `<dialog>` element specifically without JavaScript, but command/commandfor handles this and was recently added to the HTML specification:
https://github.com/whatwg/html/pull/9841