chore(htmx): upgrade htmx to v4
release.yaml / publish (push) Successful in 3m48s

This commit was merged in pull request #3.
This commit is contained in:
schreifuchs committed 2026-09-29 11:03:38 +02:00
1 parent 812891a205
commit 2a96034fca
17 files changed
+94 -95

No files matched your search

+8 -1
View File
@@ -6,11 +6,18 @@ package components
// innerHTML would replace the wrapper below (centering + close button) and
// break the layout. Content is swapped into the inner element with id
// "<id>-content" instead.
//
// In htmx 4 "htmx:after:swap" fires on the requesting element, which lives
// outside this dialog (e.g. gallery grid buttons). The listener is therefore
// attached document-wide via the bare hx-on form with "from:body" (the
// hx-on:<event> form cannot carry trigger specs: attribute names may not
// contain spaces) and guarded by ctx.target so only swaps into this dialog's
// content open it.
templ Modal(id string) {
<dialog
id={ id }
class="m-auto backdrop:bg-black/90 bg-transparent p-0 w-full h-full max-w-none max-h-none"
hx-on::after-swap="if (!this.open) this.showModal()"
hx-on="htmx:after:swap from:body -> if (!this.open && this.contains(ctx.target)) this.showModal()"
>
<div class="relative w-full h-full flex items-center justify-center overflow-hidden">
<button