fix: move channel delete-panel out of edit form (nested form bug)
CI / Build (windows/amd64) (pull_request) Successful in 21s
CI / Build (linux/amd64) (pull_request) Successful in 22s
CI / Build (linux/arm64) (pull_request) Successful in 21s
CI / Lint (pull_request) Successful in 1m11s
CI / Test (linux/amd64) (pull_request) Successful in 1m22s

The delete-panel <form action='.../delete'> was nested inside the
main <form action='.../edit'>. HTML doesn't allow nested forms —
browsers parse the inner form as if it didn't exist, so clicking
'Delete permanently' submitted the outer edit form to /edit
instead of /delete, leaving the channel intact.

Move the delete-panel block to a sibling of the main form. The
'Delete channel…' button still toggles its visibility via JS, the
panel still renders inside the page layout, and now its form
actually posts to the delete handler.
This commit is contained in:
2026-05-04 22:35:58 +01:00
parent feaeff217d
commit 7f2a9964db
+2 -2
View File
@@ -405,6 +405,8 @@
</div>
{{/* ---------- typed-confirm delete ---------- */}}
</form>{{/* close ch-form — delete panel must live OUTSIDE because HTML forbids nested forms */}}
{{if $isEdit}}
<div id="delete-panel" class="hidden mt-4 panel rounded-[7px] p-[18px]"
style="border-color: color-mix(in oklch, var(--bad), transparent 60%);">
@@ -419,8 +421,6 @@
</form>
</div>
{{end}}
</form>{{/* close ch-form */}}
</div>
{{/* ---------- right rail — payload preview ---------- */}}