fix(admin): preserve form values after save in user and group edit
SvelteKit's default `use:enhance` behaviour calls `form.reset()` after
a successful non-redirecting action, which wipes inputs that use
`value={...}` (property set, not defaultValue). The edit forms now
pass `reset: false` to `update()` so the saved values stay visible
after the success banner appears.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -94,7 +94,10 @@ const ADMIN_PERMISSIONS = $derived([
|
||||
id="edit-group-form"
|
||||
method="POST"
|
||||
action="?/update"
|
||||
use:enhance
|
||||
use:enhance={() =>
|
||||
async ({ update }) => {
|
||||
await update({ reset: false });
|
||||
}}
|
||||
oninput={unsaved.markDirty}
|
||||
>
|
||||
<!-- Group name card -->
|
||||
|
||||
@@ -85,7 +85,10 @@ $effect(() => {
|
||||
id="edit-user-form"
|
||||
method="POST"
|
||||
action="?/update"
|
||||
use:enhance
|
||||
use:enhance={() =>
|
||||
async ({ update }) => {
|
||||
await update({ reset: false });
|
||||
}}
|
||||
oninput={unsaved.markDirty}
|
||||
class="space-y-5"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user