You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting a field value to undefined either sets the value to undefined or removes the path to the value from the values.
Actual Behaviour
Setting a field value to undefined does nothing.
Previous Reasoning
When an existing array in the form values is used through a FormField to render nested array elements which also use any derivation of the FormField component, removing items from the array itself becomes impossible. The child FormField would set the field to undefined before/instead of unmounting. Efficiently preventing any removals of the items in the array.
Expected Behaviour
Setting a field value to
undefined
either sets the value toundefined
or removes the path to the value from the values.Actual Behaviour
Setting a field value to
undefined
does nothing.Previous Reasoning
When an existing array in the form values is used through a
FormField
to render nested array elements which also use any derivation of theFormField
component, removing items from the array itself becomes impossible. The childFormField
would set the field toundefined
before/instead of unmounting. Efficiently preventing any removals of the items in the array.Say we have a form which looks like this:
After you click the
<RemoveLast />
the array would become:['John', undefined]
, instead of:['John']
.Described in the following test:
domonda-js/packages/domonda-react-form/__tests__/FormField.test.tsx
Lines 330 to 383 in c18bc2f
and such behaviour is allowed by this segment:
domonda-js/packages/domonda-form/src/createFormField.ts
Lines 92 to 95 in c18bc2f
The text was updated successfully, but these errors were encountered: