v134 · dom

Dialog light dismiss

One of the nice features of the Popover API is its light dismiss behavior. This chromestatus is about bringing that same capability to `<dialog>`. A new `closedby` attribute controls behavior: `<dialog closedby=none>` - no user-triggered closing of dialogs at all. `<dialog closedby=closerequest>` - user pressing ESC (or other close trigger) closes the di

concepts

  1. Dialog Light Dismiss

    <dialog closedby> — declarative close-on-click-outside / close-on-esc. No more manual backdrop listeners.

  2. Popover parity test

    The whole motivation: dialogs should be able to behave like popovers. Side-by-side test rig with an event scoreboard for Esc, outside-click, and explicit close.

  3. CloseWatcher & Android Back

    Light dismiss routes through CloseWatcher — Android back, Escape, requestClose() all hit the same path. Probe support, see the event order, fire standalone watchers.

  4. closedby Matrix

    Quick reference + live test: which gestures dismiss each closedby value (any / closerequest / none). Open the dialogs, try every gesture, verify the table.

why it shipped

Developers sometimes would like dialog elements to exhibit "light dismiss" behavior, similar to the behavior popovers get by default. Previously, this required JS-based click handlers on the dialog and awkward logic. This feature provides easy light dismiss functionality via a declarative attribute.

references