Form / foldkit-form

Editing existing values

fill shows values as drafts, for an edit form. Keys you do not pass keep their draft.

ts
const load = RenameForm.helpers.fill({ id: 'p1', title: 'Hello' }) // an Update.Step of the page

What to load, and how a loaded value becomes input values, both follow from the form's input, which the form keeps as Rename.input:

ts
const Current = Entity.selectFor(Rename.input) // a Selection of `id` and `title`

declare const loaded: typeof Current.schema.Type
const prefill = RenameForm.helpers.fill(Entity.valuesFor(Rename.input, loaded))

A relation is loaded as a ref and read back as the id the form holds. See foldkit-entity. foldkit-crud does this, the save, and its status for you.