Skip to content

Commit b9e375c

Browse files
committed
Added caution block under delete_empty to warn the developer when he try to activate delete_empty
for collections of compound forms.
1 parent f3eaa80 commit b9e375c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

reference/forms/types/collection.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ delete_empty
268268

269269
**type**: ``Boolean`` **default**: ``false``
270270

271+
.. caution::
272+
273+
Delete empty will only remove items when the normalized value is null.
274+
If your `type`_ is a compound form type, you need to have the :ref:`required <reference-form-option-required>`
275+
option set to ``false`` inside `options`_, See :ref:`empty_data <reference-form-option-empty-data>`.
276+
277+
271278
If you want to explicitly remove entirely empty collection entries from your
272279
form you have to set this option to true. However, existing collection entries
273280
will only be deleted if you have the allow_delete_ option enabled. Otherwise

reference/forms/types/form.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ option on the form.
8080

8181
.. include:: /reference/forms/types/options/data_class.rst.inc
8282

83+
.. _reference-form-option-empty-data:
84+
8385
.. include:: /reference/forms/types/options/empty_data.rst.inc
8486
:end-before: DEFAULT_PLACEHOLDER
8587

0 commit comments

Comments
 (0)