Allow closing via click.

This commit is contained in:
Benjamin A. Shelton 2026-07-30 16:17:31 -06:00
commit b272691e37
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 7 additions and 3 deletions

View file

@ -61,8 +61,9 @@ const meta = `{
<Content />
</div>
<dialog data-scripture=""
class="p-8 bg-white rounded-sm w-full max-w-md m-auto flex-col flex hidden">
<div tabindex="-1" autofocus></div>
class="p-0 bg-white rounded-sm w-full max-w-md m-auto flex-col flex hidden">
<div tabindex="-1" autofocus class="p-4">
<p>Scripture dialog.</p></dialog>
</div>
</article>
</Layout>

View file

@ -14,7 +14,10 @@ export const bindModals = () => {
dialog[0]?.setAttribute('data-scripture', scripture);
dialog[0]?.classList.remove("hidden");
//document.body.classList.add("overflow-hidden");
});
});
dialog[0]?.addEventListener('click', (evt) => {
evt.target === dialog[0] && dialog[0]?.close();
});
};