diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 1bfe653e4e8..8153e6c1eec 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -273,6 +273,15 @@ form you have to set this option to true. However, existing collection entries will only be deleted if you have the allow_delete_ option enabled. Otherwise the empty values will be kept. +.. caution:: + + The ``delete_empty`` option only removes items when the normalized value is + ``null``. If the nested `type`_ is a compound form type, you must either set + the ``required`` option to ``false`` or set the ``empty_data`` option to + ``null``. Both of these options can be set inside `options`_. See + :ref:`form's empty_data option ` to learn + why this is necessary. + options ~~~~~~~ diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index b7d0e8e96f5..6c57283941e 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -80,6 +80,8 @@ option on the form. .. include:: /reference/forms/types/options/data_class.rst.inc +.. _reference-form-option-empty-data: + .. include:: /reference/forms/types/options/empty_data.rst.inc :end-before: DEFAULT_PLACEHOLDER