Array Output Filters (omitTrailing / omitEmpty)
options.omitTrailing lets an array offer empty rows up front while keeping them out of the value the form emits. Only trailing undefined items are dropped — leading and middle holes stay in place, so error dataPaths and validation indexes keep pointing at the row the user sees.
omitTrailing: true— opt-in; trims trailingundefinedfrom the emitted value onlyomitEmpty— on by default; an empty array disappears from its parent value- Filter order —
omitTrailingruns first,omitEmptysecond - Two channels —
node.value(raw, what renders) vsnode.normalizedValue(refined, what is emitted)
The demo below renders three arrays that share one shape (minItems: 3, string items) and differ only in their options. Each starts with three empty rows; the table under the form shows both channels side by side, so you can watch the rendered row count and the emitted value diverge.
| Path | options | Emitted at first paint |
|---|---|---|
/tags | { omitTrailing: true } | key absent ([] → omitEmpty) |
/notes | none | [null, null, null] |
/aliases | { omitTrailing: true, omitEmpty: false } | [] |
Validation reads the normalized value. Pairing minItems: 3 with omitTrailing: true means an array holding one filled row is validated as length 1, not 3. Use minItems to decide how many rows to offer only when the emitted contract also wants that many; otherwise leave it off and let users add rows.
Count rows from node.children, never from value.length — the filtered value is shorter than the rendered row count by design.