v145 · light dismiss
What closedby resolves to
An enumerated attribute with two different missing-value defaults, chosen by whether the dialog is modal. That is unusual enough to be worth measuring rather than remembering — so every combination below is set on a real dialog and read back.
Every value, in every state
| attribute | closed | show() | showModal() | what it means |
|---|
Every cell is a real <dialog> that was opened, read and closed again while you waited — off-screen, and modal dialogs included. The measurement takes a moment because opening a modal dialog is a real operation, not a property read.
Open one and see
Three dialogs, identical except for their closedby. Open each and try clicking the backdrop, then Escape.
A dialog with closedby="none" is a promise you have to keep: if the only exit is a control inside, that control must always be reachable and must always work. This one closes on the button and on nothing else, deliberately.
The popover values, for comparison
| attribute | resolves to | note |
|---|
The two attributes disagree about what a typo should mean, and both are defensible: a mistyped popover becomes manual, which stays open until told otherwise, and a mistyped closedby becomes none. Both choose the option that does not vanish unexpectedly — a dialog that a typo turned into "closes on any click" would lose the user's work.