-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
Describe the bug
When setting fields according to data (i.e. for an edit form), the form will not submit without hidden fields. Not sure if this is intentional. But I imagine it would be nice, to set fields including hidden files via fields.set as to not need to add hidden fields anymore. The form does not submit without all fields as inputs though.
<script lang="ts">
import { updatePage, getPages } from '$lib/db/remotes/page.remote';
const pages = $derived(await getPages());
updatePage.fields.set({
pageId: '6964aeb9dbcf6670463f4e4d',
title: 'test',
slug: 'slugtest',
parentId: undefined
});
</script>
<form {...updatePage}>
<label>
Title
<input {...updatePage.fields.title.as('text')} />
</label>
<label>
Slug
<input {...updatePage.fields.slug.as('text')} />
</label>
<label>
Parent Page id
<select {...updatePage.fields.parentId.as('select')}>
{#each pages as page}
<option value={page.id} selected={page.id == updatePage.fields.parentId.value()}>
{page.title}
</option>
{/each}
</select>
</label>
<button type="submit">Save</button>
</form>Reproduction
Setup remote form with valibot. Create form in +page.svelte without one of the necessary fields as seen in the code above.
Logs
System Info
not relevantSeverity
annoyance
Additional Information
No response
localer-sub and filiabel
Metadata
Metadata
Assignees
Labels
No labels