Skip to content

pantoken / formats/interactions/src / initModal

Función: initModal()

initModal(host, dialog, onCommand): void

Conecta un <dialog class="instui-modal"> de CSS o el shadow <dialog> de un componente web al protocolo de atributo open y al enrutamiento de comandos --show/--close/--toggle. Ambos usos pasan la misma interfaz:

  • CSS: host === dialog (the dialog itself carries the id and open attr)
  • WC: host = custom element, dialog = its shadow &lt;dialog&gt;

Parámetros

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Devuelve

void