All notable changes to this project are documented here. For releases before 0.19.0, see the git history.
0.21.0
Added
- Nested form entries carry a stable
dynamic_form_id, so a value referencing an entry survives edits and reordering. An entry loaded fromdatawith anidadopts it; one the user adds gets a generated id. The field round-trips through a hidden input and appears inpayload.data— it is only stable across sessions if the application persists it and passes it back indata. Opt out per nested form withgenerate_ids={false}("generateIds": false).
Fixed
- Read-only values are no longer dropped inside nested entries.
readOnlyrendered as an HTMLdisabledinput, which browsers don't submit, and the initial-data merge that covered for that restores top-level keys only — so a read-only value inside a nested entry was lost on the first change. Text controls now renderreadonly(still submitted), and controls HTML has noreadonlyfor render disabled alongside a hidden input carrying the value. Questions disabled byenableIfare unaffected: they remain excluded from the params.
0.20.0
Added
DynamicForm.form_data/1: inside a<:field>slot body, the whole form's current values as a map — the same shape aspayload.data. Always form-level, so a control inside one nested form can read another's entries.
Fixed
- The Usage guide's
type="custom"example bound:let={field}and readfield.form. That body receives the form itself, so the example raisedKeyErroras written.
0.19.0
Breaking
- Parent LiveView messages carry the lifecycle event:
{:dynamic_form, payload}is now{:dynamic_form, event, payload}. Update existing handlers tohandle_info({:dynamic_form, :success, payload}, socket)— an unmatched message raisesFunctionClauseErrorrather than failing quietly. :changeand:submitpayloads can be invalid. The previous guarantee that the parent only ever hears about valid submissions holds for:successonly.
Added
send_message_onattribute: the lifecycle events that message the parent LiveView, any of[:success, :change, :submit](default:[:success]). Listing:successalongsideon_successraises, sinceon_successreplaces that message.change_debounce_in_msattribute: milliseconds of quiet before a change runson_changeand sends its:changemessage. The built-in validations still render on every change, and submitting always runs the change pass inline.
Changed
- Adding or removing a nested entry now runs the change pass —
on_changeand the:changemessage — like any other change to the form's data.