fix(journals): add type='button' to prevent form submission and migrate to V3 Action API for file downloads

This commit is contained in:
Scott Idem
2026-02-03 22:14:22 -05:00
parent 6abe4c897e
commit 281972cb5d
24 changed files with 104 additions and 132 deletions

View File

@@ -111,7 +111,8 @@
</label>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-2">
{#each templates as template}
<button
<button type="button"
class="btn variant-ringed-surface flex flex-col gap-1 p-2 h-24 items-center justify-center border-2 text-center {selected_template_id === template.id ? 'border-primary-500 bg-primary-50 dark:bg-primary-900/20' : 'opacity-60'}"
onclick={() => { selected_template_id = template.id; generate_preview(); }}
>
@@ -144,13 +145,13 @@
<!-- Actions -->
<div class="modal-action flex justify-between items-center">
<button class="btn preset-tonal-secondary" onclick={on_close}>Close</button>
<button type="button" class="btn preset-tonal-secondary" onclick={on_close}>Close</button>
<div class="flex gap-2">
<button class="btn variant-soft-primary" onclick={handle_copy}>
<button type="button" class="btn variant-soft-primary" onclick={handle_copy}>
<Copy class="mr-2" size="1.2em" /> Copy to Clipboard
</button>
<button class="btn preset-filled-primary" onclick={handle_download}>
<button type="button" class="btn preset-filled-primary" onclick={handle_download}>
<Download class="mr-2" size="1.2em" /> Download File
</button>
</div>