Skip to content

Fields data inside an array can't be set to empty when a default is set. #4456

@abdalla-rko

Description

@abdalla-rko

Prerequisites

What theme are you using?

core

Version

5.24.1

Current Behavior

Field data inside an array can't be set to empty when a default value is set and mergeDefaultsIntoFormData is set to 'useFormDataIfPresent'. This issue only occurs when the field is directly an item of the array field. In any other cases field data can be set to an empty value.

Expected Behavior

Fields data inside an array can be set to empty when a default is set.

Steps To Reproduce

  1. Click here to open the demo
  2. Try to clear the arrayWithDefaults-1 field and you'll notice that it's not possible.
  3. Try to clear nestedField or stringField and you'll notice that it is working properly.

Environment

- OS:macos
- Node:
- npm:

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions